Skip to content

update_repository_creation_template

update_repository_creation_template(
    prefix: Prefix,
    *,
    config_overrides: Optional[ECRClientConfig] = None,
    description: Optional[RepositoryTemplateDescription] = None,
    encryption_configuration: Optional[
        EncryptionConfigurationForRepositoryCreationTemplate
    ] = None,
    resource_tags: Optional[TagList] = None,
    image_tag_mutability: Optional[ImageTagMutability] = None,
    image_tag_mutability_exclusion_filters: Optional[
        ImageTagMutabilityExclusionFilters
    ] = None,
    repository_policy: Optional[RepositoryPolicyText] = None,
    lifecycle_policy: Optional[LifecyclePolicyTextForRepositoryCreationTemplate] = None,
    applied_for: Optional[RCTAppliedForList] = None,
    custom_role_arn: Optional[CustomRoleArn] = None,
) -> UpdateRepositoryCreationTemplateResponse

Updates an existing repository creation template.

Parameters:

  • prefix (Prefix) –

    The repository namespace prefix that matches an existing repository creation template in the registry. All repositories created using this namespace prefix will have the settings defined in this template applied. For example, a prefix of prod would apply to all repositories beginning with prod/. This includes a repository named prod/team1 as well as a repository named prod/repository1.

    To apply a template to all repositories in your registry that don't have an associated creation template, you can use ROOT as the prefix.

  • description (Optional[RepositoryTemplateDescription], default: None ) –

    A description for the repository creation template.

  • resource_tags (Optional[TagList], default: None ) –

    The metadata to apply to the repository to help you categorize and organize. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

  • image_tag_mutability (Optional[ImageTagMutability], default: None ) –

    Updates the tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.

  • image_tag_mutability_exclusion_filters (Optional[ImageTagMutabilityExclusionFilters], default: None ) –

    A list of filters that specify which image tags should be excluded from the repository creation template's image tag mutability setting.

  • repository_policy (Optional[RepositoryPolicyText], default: None ) –

    Updates the repository policy created using the template. A repository policy is a permissions policy associated with a repository to control access permissions.

  • lifecycle_policy (Optional[LifecyclePolicyTextForRepositoryCreationTemplate], default: None ) –

    Updates the lifecycle policy associated with the specified repository creation template.

  • applied_for (Optional[RCTAppliedForList], default: None ) –

    Updates the list of enumerable strings representing the Amazon ECR repository creation scenarios that this template will apply towards. The supported scenarios are PULL_THROUGH_CACHE, REPLICATION, and CREATE_ON_PUSH

  • custom_role_arn (Optional[CustomRoleArn], default: None ) –

    The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as the registry that you are configuring. Amazon ECR will assume your supplied role when the customRoleArn is specified. When this field isn't specified, Amazon ECR will use the service-linked role for the repository creation template.

Raises:

Source code in docs_src/capo_ecr/_services/ecr.py
def update_repository_creation_template(
    self,
    prefix: "capo_ecr.types.prefix.Prefix",
    *,
    config_overrides: Optional[ECRClientConfig] = None,
    description: Optional[
        "capo_ecr.types.repository_template_description.RepositoryTemplateDescription"
    ] = None,
    encryption_configuration: Optional[
        "capo_ecr.types.encryption_configuration_for_repository_creation_template.EncryptionConfigurationForRepositoryCreationTemplate"
    ] = None,
    resource_tags: Optional["capo_ecr.types.tag_list.TagList"] = None,
    image_tag_mutability: Optional[
        "capo_ecr.types.image_tag_mutability.ImageTagMutability"
    ] = None,
    image_tag_mutability_exclusion_filters: Optional[
        "capo_ecr.types.image_tag_mutability_exclusion_filters.ImageTagMutabilityExclusionFilters"
    ] = None,
    repository_policy: Optional[
        "capo_ecr.types.repository_policy_text.RepositoryPolicyText"
    ] = None,
    lifecycle_policy: Optional[
        "capo_ecr.types.lifecycle_policy_text_for_repository_creation_template.LifecyclePolicyTextForRepositoryCreationTemplate"
    ] = None,
    applied_for: Optional[
        "capo_ecr.types.rct_applied_for_list.RCTAppliedForList"
    ] = None,
    custom_role_arn: Optional[
        "capo_ecr.types.custom_role_arn.CustomRoleArn"
    ] = None,
) -> "capo_ecr.types.update_repository_creation_template_response.UpdateRepositoryCreationTemplateResponse":
    """<p>Updates an existing repository creation template.</p>

    Args:
        prefix: <p>The repository namespace prefix that matches an existing repository creation template in the registry. All repositories created using this namespace prefix will have the settings defined in this template applied. For example, a prefix of <code>prod</code> would apply to all repositories beginning with <code>prod/</code>. This includes a repository named <code>prod/team1</code> as well as a repository named <code>prod/repository1</code>.</p> <p>To apply a template to all repositories in your registry that don't have an associated creation template, you can use <code>ROOT</code> as the prefix.</p>
        description: <p>A description for the repository creation template.</p>
        resource_tags: <p>The metadata to apply to the repository to help you categorize and organize. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
        image_tag_mutability: <p>Updates the tag mutability setting for the repository. If this parameter is omitted, the default setting of <code>MUTABLE</code> will be used which will allow image tags to be overwritten. If <code>IMMUTABLE</code> is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.</p>
        image_tag_mutability_exclusion_filters: <p>A list of filters that specify which image tags should be excluded from the repository creation template's image tag mutability setting.</p>
        repository_policy: <p>Updates the repository policy created using the template. A repository policy is a permissions policy associated with a repository to control access permissions. </p>
        lifecycle_policy: <p>Updates the lifecycle policy associated with the specified repository creation template.</p>
        applied_for: <p>Updates the list of enumerable strings representing the Amazon ECR repository creation scenarios that this template will apply towards. The supported scenarios are <code>PULL_THROUGH_CACHE</code>, <code>REPLICATION</code>, and <code>CREATE_ON_PUSH</code> </p>
        custom_role_arn: <p>The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as the registry that you are configuring. Amazon ECR will assume your supplied role when the customRoleArn is specified. When this field isn't specified, Amazon ECR will use the service-linked role for the repository creation template.</p>

    Raises:
        capo_ecr.errors.invalid_parameter_exception.InvalidParameterException: <p>The specified parameter is invalid. Review the available parameters for the API request.</p>
        capo_ecr.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_ecr.errors.template_not_found_exception.TemplateNotFoundException: <p>The specified repository creation template can't be found. Verify the registry ID and prefix and try again.</p>
        capo_ecr.errors.validation_exception.ValidationException: <p>There was an exception validating this request.</p>
        capo_ecr.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_ecr.types.update_repository_creation_template_request.UpdateRepositoryCreationTemplateRequest]",
    ) -> OperationResponse[
        "capo_ecr.types.update_repository_creation_template_response.UpdateRepositoryCreationTemplateResponse"
    ]:
        import capo_ecr._operations.amazon_ec2_container_registry_v20150921.update_repository_creation_template

        output, http_response = (
            capo_ecr._operations.amazon_ec2_container_registry_v20150921.update_repository_creation_template.update_repository_creation_template(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateRepositoryCreationTemplate")
    )
    input_: capo_ecr.types.update_repository_creation_template_request.UpdateRepositoryCreationTemplateRequest = {
        "prefix": prefix
    }
    if description is not None:
        input_["description"] = description
    if encryption_configuration is not None:
        input_["encryption_configuration"] = encryption_configuration
    if resource_tags is not None:
        input_["resource_tags"] = resource_tags
    if image_tag_mutability is not None:
        input_["image_tag_mutability"] = image_tag_mutability
    if image_tag_mutability_exclusion_filters is not None:
        input_["image_tag_mutability_exclusion_filters"] = (
            image_tag_mutability_exclusion_filters
        )
    if repository_policy is not None:
        input_["repository_policy"] = repository_policy
    if lifecycle_policy is not None:
        input_["lifecycle_policy"] = lifecycle_policy
    if applied_for is not None:
        input_["applied_for"] = applied_for
    if custom_role_arn is not None:
        input_["custom_role_arn"] = custom_role_arn

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output