0

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);
hermes
  • 1
  • 2
  • 1
    it is my code, but it does not working: --> This doesn't describe what the problem is. In general "problem statement" should contain "what is your expectation" and "how it is behaving". – kosa Jun 01 '17 at 21:27
  • Try to read errors using getAwsErrorCode() function. – Ravinder Reddy Jun 01 '17 at 21:30

0 Answers0