Created
October 18, 2021 15:22
-
-
Save KyMidd/e55c64810ac59fcfca8cbd387956e5db 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" "aws_ecr_repository_policy" { | |
| for_each = toset(local.account_ids) | |
| statement { | |
| sid = "KeyVaultPolicyForAccount${each.value}" #Must be unique in policy, so appending account ID | |
| effect = "Allow" | |
| principals { | |
| type = "AWS" | |
| identifiers = ["arn:aws:iam::${each.value}:root"] | |
| } | |
| actions = [ | |
| "ecr:GetDownloadUrlForLayer", | |
| "ecr:BatchGetImage", | |
| "ecr:BatchCheckLayerAvailability", | |
| ] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment