title: AWS Lambda SNS Destinations not working on failure or success
body: <p>Reference : <a href="https://aws.amazon.com/blogs/compute/introducing-aws-lambda-destinations/" rel="noreferrer">https://aws.amazon.com/blogs/compute/introducing-aws-lambda-destinations/</a></p>
  <p>Check <a href="https://stackoverflow.com/questions/59669947/aws-lambda-w-sqs-trigger-sqs-lambda-destinations-never-adds-to-destination-qu">this answer</a> said : only async lambda execution only work for destination.</p>
  <p>Lambda code :</p>
  <pre><code>const AWSManager = require('./AWSManager.js');
  const request = require('request-promise'); 
  
  exports.handler = async (event, context) =&gt; {
    var input = JSON.stringify(event, null, 2);
    console.log(event.region);
    //console.log(&quot;EVENT: \n&quot; + JSON.stringify(event, null, 2))
    // TODO implement
    var secret_name, region_name;
    if(event.secretName){
      secret_name= event.secretName;
      region_name = event.region;
      
    }else{
      secret_name= &quot;test/&quot;
      region_name = &quot;us-east-1&quot;
    }
    console.log(secret_name)
    var secret = await AWSManager.getSecret(secret_name)
    //console.log('mysecret: ' + secret )
    var secret_values = JSON.parse(secret);
    //var request = require('request');
    var okta_org_url = secret_values['okta_org_url']
    var okta_token = secret_values['okta_token']
    var api_endpoint = okta_org_url + &quot;api/v1/users?limit=25&quot;
    var options = {
      'method': 'GET',
      'url': api_endpoint,
      'headers': {
         // header information
      }
    };
    var api_response = await request(options).then(res =&gt; res).catch(err =&gt; err)
   
   
    return {
      &quot;statusCode&quot;: 200
    }
  };
  </code></pre>
  <p>Code execute properly only SNS destination doesn't work. SNS destination has email protocol subscription for sending email whenever fails.</p>