Skip to content

update_pull_through_cache_rule

update_pull_through_cache_rule(
    ecr_repository_prefix: PullThroughCacheRuleRepositoryPrefix,
    *,
    config_overrides: Optional[ECRClientConfig] = None,
    registry_id: Optional[RegistryId] = None,
    credential_arn: Optional[CredentialArn] = None,
    custom_role_arn: Optional[CustomRoleArn] = None,
) -> UpdatePullThroughCacheRuleResponse

Updates an existing pull through cache rule.

Parameters:

  • registry_id (Optional[RegistryId], default: None ) –

    The Amazon Web Services account ID associated with the registry associated with the pull through cache rule. If you do not specify a registry, the default registry is assumed.

  • ecr_repository_prefix (PullThroughCacheRuleRepositoryPrefix) –

    The repository name prefix to use when caching images from the source registry.

  • credential_arn (Optional[CredentialArn], default: None ) –

    The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret that identifies the credentials to authenticate to the upstream registry.

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

    Amazon Resource Name (ARN) of the IAM role to be assumed by Amazon ECR to authenticate to the ECR upstream registry. This role must be in the same account as the registry that you are configuring.

Raises:

Source code in docs_src/capo_ecr/_services/ecr.py
def update_pull_through_cache_rule(
    self,
    ecr_repository_prefix: "capo_ecr.types.pull_through_cache_rule_repository_prefix.PullThroughCacheRuleRepositoryPrefix",
    *,
    config_overrides: Optional[ECRClientConfig] = None,
    registry_id: Optional["capo_ecr.types.registry_id.RegistryId"] = None,
    credential_arn: Optional["capo_ecr.types.credential_arn.CredentialArn"] = None,
    custom_role_arn: Optional[
        "capo_ecr.types.custom_role_arn.CustomRoleArn"
    ] = None,
) -> "capo_ecr.types.update_pull_through_cache_rule_response.UpdatePullThroughCacheRuleResponse":
    """<p>Updates an existing pull through cache rule.</p>

    Args:
        registry_id: <p>The Amazon Web Services account ID associated with the registry associated with the pull through cache rule. If you do not specify a registry, the default registry is assumed.</p>
        ecr_repository_prefix: <p>The repository name prefix to use when caching images from the source registry.</p>
        credential_arn: <p>The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret that identifies the credentials to authenticate to the upstream registry.</p>
        custom_role_arn: <p>Amazon Resource Name (ARN) of the IAM role to be assumed by Amazon ECR to authenticate to the ECR upstream registry. This role must be in the same account as the registry that you are configuring.</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.pull_through_cache_rule_not_found_exception.PullThroughCacheRuleNotFoundException: <p>The pull through cache rule was not found. Specify a valid pull through cache rule and try again.</p>
        capo_ecr.errors.secret_not_found_exception.SecretNotFoundException: <p>The ARN of the secret specified in the pull through cache rule was not found. Update the pull through cache rule with a valid secret ARN and try again.</p>
        capo_ecr.errors.server_exception.ServerException: <p>These errors are usually caused by a server-side issue.</p>
        capo_ecr.errors.unable_to_access_secret_exception.UnableToAccessSecretException: <p>The secret is unable to be accessed. Verify the resource permissions for the secret and try again.</p>
        capo_ecr.errors.unable_to_decrypt_secret_value_exception.UnableToDecryptSecretValueException: <p>The secret is accessible but is unable to be decrypted. Verify the resource permisisons 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_pull_through_cache_rule_request.UpdatePullThroughCacheRuleRequest]",
    ) -> OperationResponse[
        "capo_ecr.types.update_pull_through_cache_rule_response.UpdatePullThroughCacheRuleResponse"
    ]:
        import capo_ecr._operations.amazon_ec2_container_registry_v20150921.update_pull_through_cache_rule

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePullThroughCacheRule")
    )
    input_: capo_ecr.types.update_pull_through_cache_rule_request.UpdatePullThroughCacheRuleRequest = {
        "ecr_repository_prefix": ecr_repository_prefix
    }
    if registry_id is not None:
        input_["registry_id"] = registry_id
    if credential_arn is not None:
        input_["credential_arn"] = credential_arn
    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