We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 601187e commit 8b0a19bCopy full SHA for 8b0a19b
main.tf
@@ -143,6 +143,25 @@ data "aws_iam_policy_document" "kms_key_policy" {
143
}
144
145
146
+ dynamic "statement" {
147
+ for_each = var.encrypt_with_kms && var.enable_deploy_role ? [1] : []
148
+ content {
149
+ sid = "Allow deploy user to use the CMK"
150
+ actions = [
151
+ "kms:GenerateDataKey*",
152
+ "kms:Encrypt",
153
+ "kms:Decrypt"
154
+ ]
155
+ resources = ["*"]
156
+
157
+ principals {
158
+ type = "AWS"
159
+ identifiers = [aws_iam_role.deploy[0].arn]
160
+ }
161
+ effect = "Allow"
162
163
164
165
statement {
166
sid = "Allow CloudFront usage of the key"
167
effect = "Allow"
0 commit comments