AppRunner and SES

1

Hello,

New to AWS, and I'm trying to configure a .NET application running in AppRunner to send email via SMTP through SES. For purposes of testing (still in sandbox mode) I verified my sending and receiving addresses and created the SMTP user/password. When sending the email, I'm getting a generic .NET timeout exception: System.Net.Mail.SmtpException: The operation has timed out.

I tried both ports 587 and 25. I deployed the same project (identical code) to both Fargate and Elastic Beanstalk, both are able to successfully send email so I don't believe it's an issue related to the code. Based on timeout, my thoughts are on a permission issue? Any help is appreciated.

Thanks!

2 Answers
0

Connection timed out means application is unable to establish connection to the AWS SES service. This could be possible due to the incorrect network configuration. Please note that when working with AWS App Runner it is required to send outbound communication via a NAT Gateway. As mentioned within the following AWS documentations [1][2], when connected to a VPC, all outbound traffic from your AppRunner service will be routed based on the VPC routing rules. Services will not have access to the public internet unless allowed by a route to a NAT Gateway.

Therefore, It is suggested to confirm if the App runner service is deployed in a Private Subnets and also please ensure that your private subnets have route to internet via NAT gateway.

References :

[1] Enabling VPC access for outgoing traffic - https://docs.aws.amazon.com/apprunner/latest/dg/network-vpc.html

[2] https://aws.amazon.com/blogs/aws/new-for-app-runner-vpc-support/

AWS
SUPPORT ENGINEER
Ankur_P
answered 2 years ago
  • Hi, @Ankur_P

    I have a question related to the re:Post guidelines.
    It looks like your answer contains no new information from the answer I gave a few days ago.
    I think this might be against the following guidelines.

    Don't copy content from others. The content and images in your posts should represent your own thoughts, work, and knowledge.

    if you have any thoughts on this, please let me know.

0

Hi, @Michael4824

You probably have App Runner's network mode set to VPC.

In that case, outbound other than HTTP responses from the container go through the custom VPC.
If the subnet your App Runner is assigned to does not have an outbound route to an SMTP server, it will time out.

You need to create a route to your NAT gateway in your subnet or a VPC endpoint for SES (SMTP).

profile picture
EXPERT
iwasa
answered 2 years ago

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.

Guidelines for Answering Questions