-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update infra-app
app
to version v0.13.0-63-g697aac4
- Loading branch information
1 parent
1ec099f
commit 6e00c5c
Showing
9 changed files
with
65 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
# Notifications configuration | ||
locals { | ||
notifications_config = var.enable_notifications ? { | ||
# Set to an SES-verified email address to be used when sending emails. | ||
# Docs: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-email.html | ||
sender_email = null | ||
# Pinpoint app name. | ||
name = "${var.app_name}-${var.environment}" | ||
|
||
# Configure the name that users see in the "From" section of their inbox, so that it's | ||
# clearer who the email is from. | ||
# Configure the name that users see in the "From" section of their inbox, | ||
# so that it's clearer who the email is from. | ||
sender_display_name = null | ||
|
||
# Set to the email address to be used when sending emails. | ||
# If enable_notifications is true, this is required. | ||
sender_email = "notifications@${var.domain_name}" | ||
|
||
# Configure the REPLY-TO email address if it should be different from the sender. | ||
# Note: Only used by the identity-provider service. | ||
reply_to_email = null | ||
reply_to_email = "notifications@${var.domain_name}" | ||
} : null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
locals { | ||
# If this is a temporary environment, re-use an existing email identity. Otherwise, create a new one. | ||
domain_identity_arn = module.app_config.enable_notifications ? ( | ||
!local.is_temporary ? | ||
module.notifications_email_domain[0].domain_identity_arn : | ||
module.existing_notifications_email_domain[0].domain_identity_arn | ||
) : null | ||
notifications_environment_variables = module.app_config.enable_notifications ? { | ||
AWS_PINPOINT_APP_ID = module.notifications[0].app_id, | ||
AWS_PINPOINT_SENDER_EMAIL = local.notifications_config.sender_email | ||
} : {} | ||
notifications_app_name = module.app_config.enable_notifications ? "${local.prefix}${local.notifications_config.name}" : "" | ||
} | ||
|
||
# If the app has `enable_notifications` set to true AND this is not a temporary | ||
# environment, then create a email notification identity. | ||
module "notifications_email_domain" { | ||
count = module.app_config.enable_notifications && !local.is_temporary ? 1 : 0 | ||
source = "../../modules/notifications-email-domain/resources" | ||
|
||
domain_name = local.service_config.domain_name | ||
} | ||
|
||
# If the app has `enable_notifications` set to true AND this *is* a temporary | ||
# environment, then create a email notification identity. | ||
module "existing_notifications_email_domain" { | ||
count = module.app_config.enable_notifications && local.is_temporary ? 1 : 0 | ||
source = "../../modules/notifications-email-domain/data" | ||
|
||
domain_name = local.service_config.domain_name | ||
} | ||
|
||
# If the app has `enable_notifications` set to true, create a new email notification | ||
# AWS Pinpoint app for the service. A new app is created for all environments, including | ||
# temporary environments. | ||
module "notifications" { | ||
count = module.app_config.enable_notifications ? 1 : 0 | ||
source = "../../modules/notifications/resources" | ||
|
||
name = local.notifications_app_name | ||
domain_identity_arn = local.domain_identity_arn | ||
sender_display_name = local.notifications_config.sender_display_name | ||
sender_email = local.notifications_config.sender_email | ||
} |
6e00c5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report for
app
Test suite run success
16 tests passing in 5 suites.
Report generated by 🧪jest coverage report action from 6e00c5c