create_pull_through_cache_rule
¶
create_pull_through_cache_rule(
ecr_repository_prefix: PullThroughCacheRuleRepositoryPrefix,
upstream_registry_url: Url,
*,
config_overrides: Optional[ECRClientConfig] = None,
registry_id: Optional[RegistryId] = None,
upstream_registry: Optional[UpstreamRegistry] = None,
credential_arn: Optional[CredentialArn] = None,
custom_role_arn: Optional[CustomRoleArn] = None,
upstream_repository_prefix: Optional[PullThroughCacheRuleRepositoryPrefix] = None,
) -> CreatePullThroughCacheRuleResponse
Creates a pull through cache rule. A pull through cache rule provides a way to cache images from an upstream registry source in your Amazon ECR private registry. For more information, see Using pull through cache rules in the Amazon Elastic Container Registry User Guide.
Parameters:
-
ecr_repository_prefix(PullThroughCacheRuleRepositoryPrefix) –The repository name prefix to use when caching images from the source registry.
There is always an assumed
/applied to the end of the prefix. If you specifyecr-publicas the prefix, Amazon ECR treats that asecr-public/. -
upstream_registry_url(Url) –The registry URL of the upstream public registry to use as the source for the pull through cache rule. The following is the syntax to use for each supported upstream registry.
-
Amazon ECR (
ecr) –.dkr.ecr. .amazonaws.com -
Amazon ECR Public (
ecr-public) –public.ecr.aws -
Docker Hub (
docker-hub) –registry-1.docker.io -
GitHub Container Registry (
github-container-registry) –ghcr.io -
GitLab Container Registry (
gitlab-container-registry) –registry.gitlab.com -
Kubernetes (
k8s) –registry.k8s.io -
Microsoft Azure Container Registry (
azure-container-registry) –.azurecr.io -
Quay (
quay) –quay.io
-
-
registry_id(Optional[RegistryId], default:None) –The Amazon Web Services account ID associated with the registry to create the pull through cache rule for. If you do not specify a registry, the default registry is assumed.
-
upstream_registry(Optional[UpstreamRegistry], default:None) –The name of the upstream 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.
-
upstream_repository_prefix(Optional[PullThroughCacheRuleRepositoryPrefix], default:None) –The repository name prefix of the upstream registry to match with the upstream repository name. When this field isn't specified, Amazon ECR will use the
ROOT.
Raises:
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
LimitExceededException–The operation did not succeed because it would have exceeded a service limit for your account. For more information, see Amazon ECR service quotas in the Amazon Elastic Container Registry User Guide.
-
PullThroughCacheRuleAlreadyExistsException–A pull through cache rule with these settings already exists for the private registry.
-
SecretNotFoundException–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.
-
ServerException–These errors are usually caused by a server-side issue.
-
UnableToAccessSecretException–The secret is unable to be accessed. Verify the resource permissions for the secret and try again.
-
UnableToDecryptSecretValueException–The secret is accessible but is unable to be decrypted. Verify the resource permisisons and try again.
-
UnsupportedUpstreamRegistryException–The specified upstream registry isn't supported.
-
ValidationException–There was an exception validating this request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ecr/_services/ecr.py
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 | |