diff --git a/infra/deployments/forms/forms-runner/main.tf b/infra/deployments/forms/forms-runner/main.tf index a8c4e739b..7c02c8e9f 100644 --- a/infra/deployments/forms/forms-runner/main.tf +++ b/infra/deployments/forms/forms-runner/main.tf @@ -67,5 +67,5 @@ module "forms_runner" { send_logs_to_cyber = var.send_logs_to_cyber bounces_and_complaints_kms_key_arn = data.terraform_remote_state.forms_ses.outputs.submission_email_bounces_and_complaints_kms_key_arn deliveries_kms_key_arn = data.terraform_remote_state.forms_ses.outputs.submission_email_successful_deliveries_kms_key_arn - + ses_submissions_enabled = var.forms_runner_settings.ses_submissions_enabled } diff --git a/infra/deployments/forms/inputs.tf b/infra/deployments/forms/inputs.tf index 1b6ab7130..2416ceeff 100644 --- a/infra/deployments/forms/inputs.tf +++ b/infra/deployments/forms/inputs.tf @@ -189,6 +189,7 @@ variable "forms_runner_settings" { allow_human_readonly_roles_to_assume_submissions_to_runner_role = bool ses_submission_email_from_email_address = string ses_submission_email_reply_to_email_address = string + ses_submissions_enabled = bool }) } diff --git a/infra/deployments/forms/tfvars/dev.tfvars b/infra/deployments/forms/tfvars/dev.tfvars index c9eb6cb3f..904d6e0e7 100644 --- a/infra/deployments/forms/tfvars/dev.tfvars +++ b/infra/deployments/forms/tfvars/dev.tfvars @@ -106,6 +106,7 @@ forms_runner_settings = { allow_human_readonly_roles_to_assume_submissions_to_runner_role = true ses_submission_email_from_email_address = "no-reply@dev.forms.service.gov.uk" ses_submission_email_reply_to_email_address = "no-reply@dev.forms.service.gov.uk" + ses_submissions_enabled = false } scheduled_smoke_tests_settings = { enable_scheduled_smoke_tests = true diff --git a/infra/deployments/forms/tfvars/production.tfvars b/infra/deployments/forms/tfvars/production.tfvars index 700dc68b8..1f77a1d97 100644 --- a/infra/deployments/forms/tfvars/production.tfvars +++ b/infra/deployments/forms/tfvars/production.tfvars @@ -150,6 +150,7 @@ forms_runner_settings = { allow_human_readonly_roles_to_assume_submissions_to_runner_role = false ses_submission_email_from_email_address = "no-reply@forms.service.gov.uk" ses_submission_email_reply_to_email_address = "no-reply@forms.service.gov.uk" + ses_submissions_enabled = false } scheduled_smoke_tests_settings = { enable_scheduled_smoke_tests = true diff --git a/infra/deployments/forms/tfvars/staging.tfvars b/infra/deployments/forms/tfvars/staging.tfvars index 6e132bc2c..d74fbd1d1 100644 --- a/infra/deployments/forms/tfvars/staging.tfvars +++ b/infra/deployments/forms/tfvars/staging.tfvars @@ -71,6 +71,7 @@ forms_runner_settings = { allow_human_readonly_roles_to_assume_submissions_to_runner_role = false ses_submission_email_from_email_address = "no-reply@staging.forms.service.gov.uk" ses_submission_email_reply_to_email_address = "no-reply@staging.forms.service.gov.uk" + ses_submissions_enabled = false } scheduled_smoke_tests_settings = { enable_scheduled_smoke_tests = true diff --git a/infra/deployments/forms/tfvars/user-research.tfvars b/infra/deployments/forms/tfvars/user-research.tfvars index 96d374714..c5ab3b790 100644 --- a/infra/deployments/forms/tfvars/user-research.tfvars +++ b/infra/deployments/forms/tfvars/user-research.tfvars @@ -69,6 +69,7 @@ forms_runner_settings = { ses_submission_email_reply_to_email_address = "no-reply@research.forms.service.gov.uk" allow_human_readonly_roles_to_assume_submissions_to_s3_role = false allow_human_readonly_roles_to_assume_submissions_to_runner_role = false + ses_submissions_enabled = false } scheduled_smoke_tests_settings = { enable_scheduled_smoke_tests = false diff --git a/infra/modules/forms-runner/main.tf b/infra/modules/forms-runner/main.tf index c8612f903..1924ada1e 100644 --- a/infra/modules/forms-runner/main.tf +++ b/infra/modules/forms-runner/main.tf @@ -190,7 +190,11 @@ module "ecs_service" { { name = "SETTINGS__SES_SUBMISSION_EMAIL__REPLY_TO_EMAIL_ADDRESS", value = var.ses_submission_email_reply_to_email_address - } + }, + { + name = "SETTINGS__FEATURES__SES_SUBMISSIONS", + value = var.ses_submissions_enabled + }, ] secrets = [ diff --git a/infra/modules/forms-runner/variables.tf b/infra/modules/forms-runner/variables.tf index ad37d211a..bbadc6c36 100644 --- a/infra/modules/forms-runner/variables.tf +++ b/infra/modules/forms-runner/variables.tf @@ -86,6 +86,12 @@ variable "api_v2_enabled" { default = false } +variable "ses_submissions_enabled" { + type = bool + description = "Use AWS SES for all submission emails when enabled." + default = false +} + variable "additional_submissions_to_s3_role_assumers" { type = list(string) description = "A list of role ARNs which are also allowed to assume the role for submissions to s3"