Skip to content

(aws-cdk-lib/aws-cognito): Set SES identity of type "Domain" as email sender #18825

@yuki-tz

Description

@yuki-tz

Description

Now we can configure email settings of Cognito UserPool using UserPoolEmail.withSES() API.
However the API makes CloudFormation template only for SES identity of type "Email address" for now, it makes deploy error when setting domain.

In particular, these settings can be succeeded to deploy,

email: UserPoolEmail.withSES({
        sesRegion: "us-east-1",
        fromEmail: "test@example.com",
        fromName: "Your Name",
        replyTo: "test@example.com",
      }),

these settings will be failed to deploy. (Sure, we can configure as this in AWS Console correctly.)

email: UserPoolEmail.withSES({
        sesRegion: "us-east-1",
        fromEmail: "example.com",
        fromName: "test@example.com",
        replyTo: "test@example.com",
      }),

Because it will generate CloudFormation template as this, and the value "From" is incorrect.

"EmailConfiguration": {
          "EmailSendingAccount": "DEVELOPER",
          "From": "test@example.com <example.com>", // format of this is invalid. "test@example.com" is correct.
          "ReplyToEmailAddress": "test@example.com",
          "SourceArn": {
            "Fn::Join": [
              "",
              [
                "arn:",
                {
                  "Ref": "AWS::Partition"
                },
                ":ses:us-east-1:",
                {
                  "Ref": "AWS::AccountId"
                },
                ":identity/example.com"
              ]
            ]
          }
        },

Use Case

For now, developers have only SES identities with type "Domain" cannot make Cognito UserPool with SES via CDK.

Proposed Solution

When argument fromEmail of UserPoolEmail.withSES() API consists only of domain string, change format of ...EmailConfiguration.From field of CloudFormation template.

Other information

No response

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-sesRelated to Amazon Simple Email Serviceclosed-for-stalenessThis issue was automatically closed because it hadn't received any attention in a while.feature-requestA feature should be added or improved.response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions