How to setup SMTP for sending emails using SES?

0

HI,
I am trying to setup SMTP configuration for sending emails using SES. Under airflow configuration I can setup almost all smtp configs, except smtp_user and smtp_password for authentication.
Then of course I get an error when trying to send an email

smtplib.SMTPSenderRefused: (530, b'Authentication required', 'mymail@test.com')

I cannot find any documentation about how to setup the email backend in MWAA.... How is supposed to be configured? Should we pass access key and secret for a smtp user? or should use the IAM Role configured for Airflow somehow?
I am curious specially about passing a secret value as plain text there... and I see that secrets manager backend is not fully operational.

Thanks in advance

6개 답변
0

Hi!

Please see the attached example configuration overrides using Gmail smtp as an example.

Thanks!

AWS
John_J
답변함 3년 전
0

Hi,
Thank you for your answer.
So for using SES, should I create an IAM user with SES credentials and then feed in the config the Access Key and Secret? Any way to protect the secrets?

Thanks

Edited by: paj-zj-99 on Feb 1, 2021 1:37 AM

답변함 3년 전
0

Just for the records in case helps others.
Setting the access key in smtp.smtp_user and the associated ses password into the smtp.smtp_password works.
The main issue for me is passing the password as a plain text config... I hope soon we get a way of securely passing such secrets

답변함 3년 전
0

In my case, the value of smtp_user option is 'apikey' and the smtp_password is 'SG.-rXXXXXXXXXXXXXXXXXXX2U'. I tried setting these values but they are not being considered. When I checked the Airflow configuration options in my environment, it did not have the smtp_user and smtp_password options. Please help me fix this.

FYI, the above options and their values work fine to send an email in an EC2 setup of Airflow but not in managed Airflow environment.

Edited by: ArjunAnaji on May 17, 2021 8:01 AM

답변함 3년 전
0

It worked somehow when I set the smtp_user and smtp_password arguments again in my environment. I'm not sure whether the issue has been fixed recently.

답변함 3년 전
0

You all should try using AWS Secrets Manager to store and retrieve your SES credentials.

klarson
답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠