v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-142314899.7 KB

Applies a repository policy to the specified public 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=SpencerFrontendService.SetRepositoryPolicy

Headers

X-Amz-Target'SpencerFrontendService.SetRepositoryPolicy' required

Request body

registryIdstring

The Amazon Web Services account ID that's associated with the registry that contains the repository. If you do not specify a registry, the default public 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 that you want 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 prevents accidental repository lockouts.

Response

Success

registryIdstring

The registry ID that's associated with the request.

repositoryNamestring

The repository name that's associated with the request.

policyTextstring

The JSON repository policy text that's applied to the repository.