Skip to content

Add SES email capture for E2E tests#2121

Open
theseanything wants to merge 1 commit into
mainfrom
theseanything/use-ses-email-recieving-for-tests
Open

Add SES email capture for E2E tests#2121
theseanything wants to merge 1 commit into
mainfrom
theseanything/use-ses-email-recieving-for-tests

Conversation

@theseanything
Copy link
Copy Markdown
Contributor

Receive test confirmation and submission emails into S3 so “get a copy of your answers” flows can be tested.

This creates a seperate S3 bucket for emails, and has receipt rules to sort different email receiptents into different folders.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds inbound SES email capture to support end-to-end tests for “get a copy of your answers” and related email flows by storing received emails in S3 and exposing the bucket name via Terraform outputs. It also completes SES domain identity verification by creating the required Route53 TXT record and verification resource.

Changes:

  • Add an SES receipt rule set with rules to write specific test-recipient emails into prefixed folders in a new S3 bucket.
  • Add SES domain identity verification DNS record + aws_ses_domain_identity_verification.
  • Export the test email S3 bucket name from the SES module and the forms SES deployment.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
infra/modules/ses/test_mail.tf Creates the test emails S3 bucket and SES inbound receipt rules to store emails in S3 prefixes.
infra/modules/ses/dns.tf Adds SES domain verification TXT record and verification resource.
infra/modules/ses/outputs.tf Exposes the test mail bucket name from the SES module.
infra/deployments/forms/ses/outputs.tf Plumbs the SES module’s test mail bucket name output to the deployment outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread infra/modules/ses/test_mail.tf
Comment thread infra/modules/ses/test_mail.tf
Comment thread infra/modules/ses/test_mail.tf
Receive test confirmation and submission emails into S3 so “get a copy
of your answers” flows can be tested.

This creates a seperate S3 bucket for emails, and has receipt rules to
sort different email receiptents into different folders.
@theseanything theseanything force-pushed the theseanything/use-ses-email-recieving-for-tests branch from 5ff2e76 to 1d12add Compare May 13, 2026 14:54
@theseanything theseanything requested a review from a team May 13, 2026 14:56
Copy link
Copy Markdown
Contributor

@whi-tw whi-tw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, except we don't just create buckets with the standard resource - we always use our bucket modules. secure-bucket is likely the right one for this job

Comment on lines +25 to +34
resource "aws_s3_bucket" "test_mail_bucket" {
#checkov:skip=CKV2_AWS_62:No event notifications are needed for this temporary test email bucket
#checkov:skip=CKV_AWS_145:Amazon managed S3 encryption is sufficient for temporary test emails
#checkov:skip=CKV_AWS_18:Access logging is not needed for this temporary test email bucket
#checkov:skip=CKV_AWS_144:Cross-region replication is not needed for temporary test emails
#checkov:skip=CKV2_AWS_6:Public access is controlled by the bucket policy for SES writes only
#checkov:skip=CKV_AWS_21:Versioning is not needed for temporary test emails that expire after 7 days
bucket = local.test_mail_bucket_name
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use one of our bucket modules for this, rather than rolling a separate bucket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants