Created
August 10, 2020 04:32
-
-
Save mailman-2097/86b6d57af006049cf8f27b7e145fa1f5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| data "aws_iam_policy_document" "kms_policy" { | |
| statement { | |
| sid = "Enable Root user permissions" | |
| effect = "Allow" | |
| actions = ["kms:*"] | |
| resources = ["*"] | |
| principals { | |
| type = "AWS" | |
| identifiers = [ | |
| "arn:aws:iam::${local.account_id}:root", | |
| ] | |
| } | |
| } | |
| statement { | |
| sid = "Allow use of the key for cross account roles" | |
| effect = "Allow" | |
| actions = [ | |
| "kms:Encrypt", | |
| "kms:Decrypt", | |
| "kms:ReEncrypt*", | |
| "kms:GenerateDataKey*", | |
| "kms:DescribeKey", | |
| "kms:CreateGrant", | |
| "kms:ListGrants", | |
| "kms:RevokeGrant", | |
| ] | |
| resources = ["*"] | |
| principals { | |
| type = "AWS" | |
| identifiers = ["*"] | |
| } | |
| condition { | |
| test = "ForAnyValue:StringEquals" | |
| variable = "aws:PrincipalOrgPaths" | |
| values = [ | |
| local.target_principal_path, | |
| local.security_ou_principal_path | |
| ] | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment