create_repository
async
¶
create_repository(
repository_name: RepositoryName,
*,
config_overrides: Optional[AsyncECRClientConfig] = None,
registry_id: Optional[RegistryId] = None,
tags: Optional[TagList] = None,
image_tag_mutability: Optional[ImageTagMutability] = None,
image_tag_mutability_exclusion_filters: Optional[
ImageTagMutabilityExclusionFilters
] = None,
image_scanning_configuration: Optional[ImageScanningConfiguration] = None,
encryption_configuration: Optional[EncryptionConfiguration] = None,
) -> CreateRepositoryResponse
Creates a repository. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide.
Parameters:
-
registry_id(Optional[RegistryId], default:None) –The Amazon Web Services account ID associated with the registry to create the repository. If you do not specify a registry, the default registry is assumed.
-
repository_name(RepositoryName) –The name to use for the repository. The repository name may be specified on its own (such as
nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such asproject-a/nginx-web-app).The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes.
-
tags(Optional[TagList], default:None) –The metadata that you apply to the repository to help you categorize and organize them. 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's image tag mutability setting.
-
image_scanning_configuration(Optional[ImageScanningConfiguration], default:None) –The
imageScanningConfigurationparameter is being deprecated, in favor of specifying the image scanning configuration at the registry level. For more information, seePutRegistryScanningConfiguration.The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
-
encryption_configuration(Optional[EncryptionConfiguration], default:None) –The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
Raises:
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
InvalidTagParameterException–An invalid parameter has been specified. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
-
KmsException–The operation failed due to a KMS exception.
-
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.
-
RepositoryAlreadyExistsException–The specified repository already exists in the specified registry.
-
ServerException–These errors are usually caused by a server-side issue.
-
TooManyTagsException–The list of tags on the repository is over the limit. The maximum number of tags that can be applied to a repository is 50.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To create a new repository This example creates a repository called nginx-web-app inside the project-a namespace in the default registry for an account.
Source code in docs_src/capo_ecr/_services/async_ecr.py
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 | |