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_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 -
Amazon ECR Public Premium (
ecr-public-premium) –ecr-premium.aws.com, the registry endpoint for Amazon ECR Public Premium images -
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. You can't use this parameter with the Amazon ECR Public Premium upstream registry.
-
custom_role_arn(Optional[CustomRoleArn], default:None) –The Amazon Resource Name (ARN) of the IAM role that Amazon ECR assumes to authenticate to the upstream registry. This role must be in the same account as the registry that you are configuring.
For an Amazon ECR Public Premium upstream registry, specify this role together with
upstreamRoleArn. If you specify neither role, Amazon ECR uses its service-linked role. -
upstream_role_arn(Optional[CustomRoleArn], default:None) –The Amazon Resource Name (ARN) of the IAM role in the
awspartition that Amazon ECR assumes throughcustomRoleArnto authenticate to the Amazon ECR Public Premium upstream registry. You can use this parameter only for the Amazon ECR Public Premium upstream registry, and it requirescustomRoleArn. -
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
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 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 | |