I really want to publish a lambda subscriber to an SNS topic. It works in amazon console, but with php-sdk it does not. When I execute the php code and I look in CloudWatch, there's nothing (no response). Why my SNS did not work?
it is my code, but it does not working:
....
$credentials = new Credentials($access, $secret);
$this->aws_client = new SnsClient(
array(
'region' => 'us-east-1',
'version' => 'latest',//'version' => '2010-03-31',
'credentials' => $credentials
)
);
...
$message = "Hello H.";
$message_atr = array('String' => array('DataType' => 'String', 'StringValue' => $message));
$payload = array(
'TargetArn' => 'arn:aws:sns:us-east-1:****:mysns',
'Message' => $message,
'MessageAttributes' => $message_atr,
);
$this->aws_client->publish($payload);