create_repository_creation_template
¶
create_repository_creation_template(
prefix: Prefix,
applied_for: RCTAppliedForList,
*,
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,
custom_role_arn: Optional[CustomRoleArn] = None,
) -> CreateRepositoryCreationTemplateResponse
Creates a repository creation template. This template is used to define the settings for repositories created by Amazon ECR on your behalf. For example, repositories created through pull through cache actions. For more information, see Private repository creation templates in the Amazon Elastic Container Registry User Guide.
Parameters:
-
prefix(Prefix) –The repository namespace prefix to associate with the template. All repositories created using this namespace prefix will have the settings defined in this template applied. For example, a prefix of
prodwould apply to all repositories beginning withprod/. Similarly, a prefix ofprod/teamwould apply to all repositories beginning withprod/team/.To apply a template to all repositories in your registry that don't have an associated creation template, you can use
ROOTas the prefix.There is always an assumed
/applied to the end of the prefix. If you specifyecr-publicas the prefix, Amazon ECR treats that asecr-public/. When using a pull through cache rule, the repository prefix you specify during rule creation is what you should specify as your repository creation template prefix as well. -
description(Optional[RepositoryTemplateDescription], default:None) –A description for the repository creation template.
-
encryption_configuration(Optional[EncryptionConfigurationForRepositoryCreationTemplate], default:None) –The encryption configuration to use for repositories created using the 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) –The tag mutability setting for the repository. If this parameter is omitted, the default setting of
MUTABLEwill be used which will allow image tags to be overwritten. IfIMMUTABLEis 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) –The repository policy to apply to repositories 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) –The lifecycle policy to use for repositories created using the template.
-
applied_for(RCTAppliedForList) –A 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, andCREATE_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:
-
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.
-
ServerException–These errors are usually caused by a server-side issue.
-
TemplateAlreadyExistsException–The repository creation template already exists. Specify a unique prefix and try again.
-
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
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 | |