Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aws-cognito] Setting from in emailSettings on a Cognito User pool causes the construct to fail #9739

Closed
gregorypierce opened this issue Aug 15, 2020 · 2 comments
Assignees
Labels
@aws-cdk/aws-cognito Related to Amazon Cognito bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while.

Comments

@gregorypierce
Copy link

Specifying the from in the emailSettings for a user pool causes the construct to fail with "Cannot configure From email address for default email configuration (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: c3ab1c5c-d6e5-4ab9-8bac-e604fdc2b175; Proxy: null)"

Reproduction Steps

Create a cognito.UserPool and set the emailSettings property:

         emailSettings: {
             from: 'noreply@' + props.domainName,
             replyTo: 'support@' + props.domainName
         },

What did you expect to happen?

The Cognito system will be configured to deliver email messages with a from and reply to as specified

What actually happened?

The construct will fail with Cannot configure From email address for default email configuration (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException; Request ID: c3ab1c5c-d6e5-4ab9-8bac-e604fdc2b175; Proxy: null).

This isn't specified anywhere in the documentation that you cannot do this for the default email configuration.

Environment

  • CLI Version :
  • Framework Version: 1.58
  • Node.js Version: 12.16.3
  • OS : ANY
  • Language (Version): ALL

Other

Change documentation to:

Cognito sends emails to users in the user pool, when particular actions take place, such as welcome emails, invitation emails, password resets, etc. The address from which these emails are sent can be configured on the user pool . Read more about email settings here.


This is 🐛 Bug Report

@gregorypierce gregorypierce added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 15, 2020
@github-actions github-actions bot added the @aws-cdk/aws-cognito Related to Amazon Cognito label Aug 15, 2020
@nija-at
Copy link
Contributor

nija-at commented Aug 17, 2020

This is an error from the Cognito service. The CDK simply passes this value down to the From CloudFormation attribute.

Searching for this error on google - https://www.google.com/search?q=%22Cannot+configure+From+email+address+for+default+email+configuration%22 - it seems that this attribute may be reserved when used with SES only. You may have to dig in a little deeper to confirm this or talk to AWS support around this.

As for the CDK, we have an issue tracking SES implementation - #6768

@nija-at nija-at added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Aug 17, 2020
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Aug 18, 2020
@github-actions github-actions bot added closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 22, 2020
@JoshM1994
Copy link

For those who are looking for a quick solution, I implement the following:

        const userPoolCfn = userPool.node.defaultChild as CfnUserPool;
        userPoolCfn.emailConfiguration = {
            emailSendingAccount: 'DEVELOPER',
            sourceArn: `arn:aws:ses:${Aws.REGION}:${Aws.ACCOUNT_ID}:identity/${VERIFIED_EMAIL_IDENTIY}`,
        };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cognito Related to Amazon Cognito bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while.
Projects
None yet
Development

No branches or pull requests

4 participants