Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created June 20, 2021 18:39
Show Gist options
  • Save KyMidd/f7ab152f79a66c5ffc0058e20c3f8d9a to your computer and use it in GitHub Desktop.
Save KyMidd/f7ab152f79a66c5ffc0058e20c3f8d9a to your computer and use it in GitHub Desktop.
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