Skip to content

The SNS service in sns.ap-southeast-2 is not working when invoked from the EC2 instance.

0

I’m trying to send emails via the AWS SNS service, via a script on the EC2 instance however I’m getting a time out error message.

To validate this tried running curl and got the following curl -v https://sns.ap-southeast-2.amazonaws.com

  • Host sns.ap-southeast-2.amazonaws.com:443 was resolved.
  • IPv6: (none)
  • IPv4: 172.31.28.33, 172.31.38.196, 172.31.15.41
  • Trying 172.31.28.33:443...
  • connect to 172.31.28.33 port 443 from 0.0.0.0 port 63081 failed: Timed out
  • Trying 172.31.38.196:443...
  • connect to 172.31.38.196 port 443 from 0.0.0.0 port 63083 failed: Timed out

I have re-validated the security configurations of the EC2 instance, and all the settings required to publish the SNS message are configured properly:

  1. Validated the IAM role associated with the EC2 instance.
  2. Checked the subnet configuration.
  3. Reviewed ACL (Access Control List) settings.
  4. Inspected inbound and outbound rules.

However, I noticed that the issue occurs specifically with the SNS topic in the **ap-southeast-2 region. **I tried using another region, and it worked as expected.

Additionally, I ran an nslookup, and the results for ap-southeast-2 are unusual compared to those of other regions (please find the attached results). nslookup details

Please find the screen-shot of Curl Response from other region Curl Response from other region

Note: SNS of the problematic region (ap-southeast-2) worked from Lambda function as well as from my personal laptop using the script.

Therefore, I kindly request you to share the resolution steps to overcome this issue.

1 Answer
1
Accepted Answer

Hello.

Is a VPC endpoint for SNS set in the VPC running EC2?
Since the private IP address was confirmed when performing name resolution, a VPC endpoint was probably set.
In this case, you need to configure an inbound rule to allow HTTPS access from EC2 in the VPC endpoint's security group.
https://docs.aws.amazon.com/sns/latest/dg/sns-vpc-create-endpoint.html

EXPERT
answered a year ago
EXPERT
reviewed a year ago
  • Thanks Riku . It worked after implementing the changes mentioned in the comment.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.