-
-
Save KyMidd/f7ab152f79a66c5ffc0058e20c3f8d9a to your computer and use it in GitHub Desktop.
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
resource "aws_kms_key" "hub_secrets_manager_cmk" { | |
description = "KMS CMK for Secrets Manager" | |
policy = jsonencode( | |
{ | |
"Version" : "2012-10-17", | |
"Id" : "auto-secretsmanager-2", | |
"Statement" : [ | |
{ | |
"Sid" : "Enable IAM User Permissions", | |
"Effect" : "Allow", | |
"Principal" : { | |
"AWS" : "arn:aws:iam::aaaaaaaaaaa:root" #Root account ARN (remember to remove these comments before deploying, json doesn't like comments) | |
}, | |
"Action" : "kms:*", | |
"Resource" : "*" | |
}, | |
{ | |
"Sid" : "SpokeBuilderAccess", | |
"Effect" : "Allow", | |
"Action" : [ | |
"kms:Decrypt", | |
"kms:DescribeKey" | |
], | |
"Resource" : "*", | |
"Principal" : { | |
"AWS" : [ | |
"arn:aws:iam::bbbbbbbbbb:role/SpokeABuilderExecutionRole" | |
] | |
} | |
} | |
] | |
} | |
) | |
tags = { | |
Terraform = "true" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment