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

Allow customer managed KMS key for backup SNS topic #397

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/backup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ resource "aws_backup_selection" "non_production" {
}

# SNS topic
#trivy:ignore:avd-aws-0136
resource "aws_sns_topic" "backup_failure_topic" {
kms_master_key_id = "alias/aws/sns"
kms_master_key_id = var.sns_backup_topic_key
name = "backup_failure_topic"
tags = merge(var.tags, {
Description = "This backup topic is so the MP team can subscribe to backup notifications from selected accounts and teams using member-unrestricted accounts can create their own subscriptions"
Expand Down
6 changes: 6 additions & 0 deletions modules/backup/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ variable "iam_role_arn" {
description = "IAM role ARN for the AWS Backup service role"
}

variable "sns_backup_topic_key" {
type = string
default = "alias/aws/sns"
description = "KMS key used to encrypt backup failure SNS topic"
}

variable "tags" {
default = {}
description = "Tags to apply to resources, where applicable"
Expand Down
Loading