ecr:SetRepositoryPolicy

Permissions management

ecr:SetRepositoryPolicy is a Permissions management access-level action in the ecr service. Grants permission to apply a repository policy on a specified repository to control access permissions

Resource types

ARNs that ecr:SetRepositoryPolicy can be scoped to in an IAM policy.

arn:${Partition}:ecr:${Region}:${Account}:repository/${RepositoryName}
repository

Condition keys

Keys you can use in the Condition block of a policy that grants ecr:SetRepositoryPolicy.

aws:ResourceTag/${TagKey} String

Filters access by tag-value associated with the resource

ecr:ResourceTag/${TagKey} String

Filters access by tag-value associated with the resource

Example IAM policy

A minimal policy that allows ecr:SetRepositoryPolicy. Replace "Resource": "*" with a specific ARN to follow least privilege.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowEcrSetRepositoryPolicy",
      "Effect": "Allow",
      "Action": "ecr:SetRepositoryPolicy",
      "Resource": "*"
    }
  ]
}

Related actions in ecr

View all ecr actions →