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:
- Validated the IAM role associated with the EC2 instance.
- Checked the subnet configuration.
- Reviewed ACL (Access Control List) settings.
- 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).

Please find the screen-shot of 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.
Thanks Riku . It worked after implementing the changes mentioned in the comment.