Skip to content

Commit

Permalink
Merge pull request #6130 from ministryofjustice/feature/kms-secrets-k…
Browse files Browse the repository at this point in the history
…ey-multi-region

Added kms secrets_key_multi_region
  • Loading branch information
AafAnsari authored Feb 5, 2024
2 parents 42e766e + 7b811be commit 65507d2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions terraform/modernisation-platform-account/secrets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ resource "aws_kms_alias" "secrets_key" {
target_key_id = aws_kms_key.secrets_key.id
}

resource "aws_kms_key" "secrets_key_multi_region" {
description = "AWS Secretsmanager CMK"
policy = data.aws_iam_policy_document.kms_secrets_key.json
enable_key_rotation = true
deletion_window_in_days = 30
multi_region = true
}

resource "aws_kms_alias" "secrets_key_multi_region" {
name = "alias/secrets-key-multi-region"
target_key_id = aws_kms_key.secrets_key_multi_region.id
}

data "aws_iam_policy_document" "kms_secrets_key" {
#cannot reference secret in resources for statement as this causes cyclic error
#checkov:skip=CKV_AWS_108: Cannot set resource as not known at time document is created, causing a cyclic error
Expand Down

0 comments on commit 65507d2

Please sign in to comment.