v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1441293181.2 KB

Applies a repository policy to the specified repository to control access permissions. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policies.html">Amazon ECR Repository policies</a> in the <i>Amazon Elastic Container Registry User Guide</i>.

post/#X-Amz-Target=AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy

Headers

X-Amz-Target'AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy' required

Request body

registryIdstring

The Amazon Web Services account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.

repositoryNamestring required

The name of the repository to receive the policy.

policyTextstring required

The JSON repository policy text to apply to the repository. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html">Amazon ECR repository policies</a> in the <i>Amazon Elastic Container Registry User Guide</i>.

forceboolean

If the policy you are attempting to set on a repository policy would prevent you from setting another policy in the future, you must force the <a>SetRepositoryPolicy</a> operation. This is intended to prevent accidental repository lock outs.

Response

Success

registryIdstring

The registry ID associated with the request.

repositoryNamestring

The repository name associated with the request.

policyTextstring

The JSON repository policy text applied to the repository.