set_repository_policy
async
¶
set_repository_policy(
repository_name: RepositoryName,
policy_text: RepositoryPolicyText,
*,
config_overrides: Optional[AsyncECRClientConfig] = None,
registry_id: Optional[RegistryId] = None,
force: Optional[ForceFlag] = None,
) -> SetRepositoryPolicyResponse
Applies a repository policy to the specified repository to control access permissions. For more information, see Amazon ECR Repository policies in the Amazon Elastic Container Registry User Guide.
Parameters:
-
registry_id(Optional[RegistryId], default:None) –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.
-
repository_name(RepositoryName) –The name of the repository to receive the policy.
-
policy_text(RepositoryPolicyText) –The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide.
-
force(Optional[ForceFlag], default:None) –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 SetRepositoryPolicy operation. This is intended to prevent accidental repository lock outs.
Raises:
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
RepositoryNotFoundException–The specified repository could not be found. Check the spelling of the specified repository and ensure that you are performing operations on the correct registry.
-
ServerException–These errors are usually caused by a server-side issue.
-
UnknownServiceError–The service returned an error code this client does not model.