aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

Configuring Cognito SES settings. #1265

Closed jarrettj closed 5 years ago

jarrettj commented 5 years ago

Which Category is your question related to? amplify auth add

What AWS Services are you utilizing? Cognito and SES.

Provide additional details e.g. code snippets How would you go about changing the SES settings via cloud formation? I've attached a screeshot as well.

image

Regards.

kaustavghosh06 commented 5 years ago

@jarrettj Did you take a look at the Cloudformation fields supported by Cognito? Is SES supported in it?

kaustavghosh06 commented 5 years ago

If it's not inherently supported by Cognito Cloudformation, then i would recommend writing a custom resource (lambda function) in your Cloudformation similar to some other custom resources we support as a part of the auth/cognito cloudformation currently.

jarrettj commented 5 years ago

Hi,

It does not look as though it is supported by CF. It should be, but when I update the CF template, the changes do not take effect.

      EmailConfiguration:
        SourceArn: "arn:aws:ses:eu-west-1:*************:identity/test@example.com"

Seems to work, the from email changes. But there's no option to change the region, and I think that is why it breaks. Will post to the forums as well. Think this is more of a CF issue. For now I'll manually set it up. As once we go live, the User Pool will probably not change.

Thanks.

mjmaix commented 5 years ago

Hi @kaustavghosh06, EmailConfiguration should be supported by Cloudformation -> link to UserPool EmailConfiguration

Caution is that any manually configured EmailConfiguration on the User Pool will be lost and reverted to DEFAULT if aws auth push is run.

Though it might not be a big issue if the User Pool does not change often, it is still a feature that will be very useful available on the CLI.

sukeshn commented 5 years ago

CloudFormation UserPool EmailConfiguration doesn't work.

I gave following input in cloud formation template:

arn:aws:ses:us-east-1:************:identity/support@xxxxxxx.com

I get following CloudFormation error.

1 validation error detected: Value ' arn:aws:ses:us-east-1:************:identity/support@xxxxxxx.com' at 'emailConfiguration.sourceArn' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:[\w+=/,.@-]+:[\w+=/,.@-]+:([\w+=/,.@-]*)?:[0-9]+:[\w+=/,.@-]+(:[\w+=/,.@-]+)?(:[\w+=/,.@-]+)? (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: 3522e111-4841-4f1b-8563-dc8957b68e28)

jarrettj commented 5 years ago

If you are in the us-east region it should work. You copy/pasted your arn from the SES service? Very strange.

sukeshn commented 5 years ago

Jarrettj, sorry it was my bad, there was a whitespace at the start of the arn.

jarrettj commented 5 years ago

Cool man, glad you got it “working”. Hopefully better CF support is on the way for SES.


From: Sukesh Nemane notifications@github.com Sent: Saturday, June 29, 2019 9:18 AM To: aws-amplify/amplify-cli Cc: jarrett jordaan; Mention Subject: Re: [aws-amplify/amplify-cli] Configuring Cognito SES settings. (#1265)

Jarrettj, sorry it was my bad, there was a whitespace at the start of the arn.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/aws-amplify/amplify-cli/issues/1265?email_source=notifications&email_token=AAF52S7F5H2C5MX6V3RIFMDP44EC3A5CNFSM4HFQOLWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY3TOZQ#issuecomment-506935142, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAF52S7HMNIGYCT64LIRLZ3P44EC3ANCNFSM4HFQOLWA.

borisdayma commented 4 years ago

@sukeshn I've been trying to achieve the same but am having some difficulty (not much experience with CloudFormation). Would you be able to explain in more details what you did?

Did you add a new custom resource similar to this? Or did you update your specific backend resources? I understand it is amplify/backend/function/CustomMessage for verification links and amplify/backend/auth/XXX for other cognito activities (reset password, confirmation code, etc)? Or maybe both?

In the end I'd like any email to be sent from a custom email address.

borisdayma commented 4 years ago

@jarrettj Would it be possible to add details on how to do it in the documentation?

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.