set_repository_policy
async
¶
set_repository_policy(
repository_name: RepositoryName,
policy_text: RepositoryPolicyText,
*,
config_overrides: Optional[AsyncECRPUBLICClientConfig] = None,
registry_id: Optional[RegistryId] = None,
force: Optional[ForceFlag] = None,
) -> SetRepositoryPolicyResponse
Applies a repository policy to the specified public 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 that's associated with the registry that contains the repository. If you do not specify a registry, the default public 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 that you want to set on a repository policy would prevent you from setting another policy in the future, you must force the SetRepositoryPolicy operation. This prevents accidental repository lockouts.
Raises:
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
RepositoryNotFoundException–The specified repository can't be found. Check the spelling of the specified repository and ensure that you're performing operations on the correct registry.
-
ServerException–These errors are usually caused by a server-side issue.
-
UnsupportedCommandException–The action isn't supported in this Region.
-
UnknownServiceError–The service returned an error code this client does not model.