Skip to content

Commit b466748

Browse files
committed
fix(tf): ecr:GetAuthorizationToken IAM permission
This action *doesn't support* restricting the resource, and AgentCore runtime deployment failed with the previous configuration.
1 parent e75b929 commit b466748

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

infra/modules/agentcore-iam-role/bedrock-agentcore-policy.tf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ resource "aws_iam_policy" "ecr_permissions" {
3232
Effect = "Allow"
3333
Action = [
3434
"ecr:BatchGetImage",
35-
"ecr:GetDownloadUrlForLayer",
36-
"ecr:GetAuthorizationToken"
35+
"ecr:GetDownloadUrlForLayer"
3736
]
3837
Resource = [
3938
"arn:aws:ecr:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:repository/*"
@@ -45,9 +44,9 @@ resource "aws_iam_policy" "ecr_permissions" {
4544
Action = [
4645
"ecr:GetAuthorizationToken"
4746
]
48-
Resource = [
49-
"arn:aws:ecr:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:*"
50-
]
47+
# This action does not accept any restrictions on the resource, per the docs:
48+
# https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonelasticcontainerregistry.html
49+
Resource = "*"
5150
}
5251
]
5352
})

0 commit comments

Comments
 (0)