AWS::ECR::Repository¶
The AWS::ECR::Repository resource specifies an Amazon Elastic Container Registry (Amazon ECR) repository, where users can push and pull Docker images, Op...
Generated by cfn-typegen --out cfn_types AWS::ECR::Repository into cfn_types/ecr.py:
# Generated by cfn-typegen from the CloudFormation registry schemas. Do not edit.
# fmt: off
# ruff: noqa
"""AWS::ECR resources."""
from collections.abc import Mapping, Sequence
from typing import Any, Literal, NotRequired, Unpack
from typing_extensions import TypedDict
from cfn_typed.base import DeletionPolicy, DependsOn, ResourceAttrs, Tag, UpdateReplacePolicy, build
from cfn_typed.intrinsics import Expr
CONSTRAINTS:dict[str,Any]={
'AWS::ECR::Repository':{'LifecyclePolicy':{'P':{'LifecyclePolicyText':{'l':100,'L':30720},'RegistryId':{'p':"^[0-9]{12}$",'l':12,'L':12}}},'RepositoryName':{'p':"^(?=.{2,256}$)([a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*(\\/[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*)*)$",'l':2,'L':256},'Tags':{'I':50,'T':{'P':{'Key':{'l':1,'L':127},'Value':{'l':1,'L':255}}}},'ImageTagMutability':{'e':["MUTABLE","IMMUTABLE","MUTABLE_WITH_EXCLUSION","IMMUTABLE_WITH_EXCLUSION"]},'ImageTagMutabilityExclusionFilters':{'i':1,'I':5,'T':{'P':{'ImageTagMutabilityExclusionFilterType':{'e':["WILDCARD"]},'ImageTagMutabilityExclusionFilterValue':{'p':"^[0-9a-zA-Z._*-]{1,128}",'l':1,'L':128}}}},'EncryptionConfiguration':{'P':{'EncryptionType':{'e':["AES256","KMS","KMS_DSSE"]},'KmsKey':{'l':1,'L':2048}}}},
}
ATTRIBUTES:dict[str,Any]={"AWS::ECR::Repository":["Arn","RepositoryName","RepositoryUri"]}
RULES:dict[str,Any]={}
Nested types (7)
These are defined above the properties in the generated module.
class RepositoryLifecyclePolicy(TypedDict, closed=True):
'The ``LifecyclePolicy`` property type specifies a lifecycle policy.'
LifecyclePolicyText: NotRequired[Expr[str]]
'The JSON repository policy text to apply to the repository.'
RegistryId: NotRequired[Expr[str]]
'The AWS account ID associated with the registry that contains the repository.'
class RepositoryImageTagMutabilityExclusionFilter(TypedDict, closed=True):
"A filter that specifies which image tags should be excluded from the repository's image tag mutability setting."
ImageTagMutabilityExclusionFilterType: Expr[str]
ImageTagMutabilityExclusionFilterValue: Expr[str]
class RepositoryImageScanningConfiguration(TypedDict, closed=True):
'The image scanning configuration for a repository.'
ScanOnPush: NotRequired[Expr[bool]]
'The setting that determines whether images are scanned after being pushed to a repository.'
class RepositoryEncryptionConfiguration(TypedDict, closed=True):
'The encryption configuration for the repository.'
EncryptionType: Expr[str]
'The encryption type to use.'
KmsKey: NotRequired[Expr[str]]
'If you use the ``KMS`` encryption type, specify the KMS key to use for encryption.'
class RepositoryProps(TypedDict, closed=True):
'The ``AWS::ECR::Repository`` resource specifies an Amazon Elastic Container Registry (Amazon ECR) repository, where users can push and pull Docker images, Op...'
EmptyOnDelete: NotRequired[Expr[bool]]
'If true, deleting the repository force deletes the contents of the repository.'
LifecyclePolicy: NotRequired[Expr[RepositoryLifecyclePolicy]]
'Creates or updates a lifecycle policy.'
RepositoryName: NotRequired[Expr[str]]
'The name to use for the repository.'
RepositoryPolicyText: NotRequired[Expr[Mapping[str, Any]] | Expr[str]]
'The JSON repository policy text to apply to the repository.'
Tags: NotRequired[Expr[Sequence[Expr[Tag]]]]
'An array of key-value pairs to apply to this resource.'
ImageTagMutability: NotRequired[Expr[str]]
'The tag mutability setting for the repository.'
ImageTagMutabilityExclusionFilters: NotRequired[Expr[Sequence[Expr[RepositoryImageTagMutabilityExclusionFilter]]]]
"A list of filters that specify which image tags are excluded from the repository's image tag mutability setting."
ImageScanningConfiguration: NotRequired[Expr[RepositoryImageScanningConfiguration]]
'The ``imageScanningConfiguration`` parameter is being deprecated, in favor of specifying the image scanning configuration at the registry level.'
EncryptionConfiguration: NotRequired[Expr[RepositoryEncryptionConfiguration]]
'The encryption configuration for the repository.'
class Repository(ResourceAttrs):
'The ``AWS::ECR::Repository`` resource specifies an Amazon Elastic Container Registry (Amazon ECR) repository, where users can push and pull Docker images, Op...'
Type: Literal['AWS::ECR::Repository']
Properties: NotRequired[RepositoryProps]
def repository(
*,
depends_on: DependsOn | None = None,
deletion_policy: DeletionPolicy | None = None,
update_replace_policy: UpdateReplacePolicy | None = None,
condition: str | None = None,
metadata: dict[str, Any] | None = None,
**props: Unpack[RepositoryProps],
) -> Repository:
return build('AWS::ECR::Repository', props, depends_on, deletion_policy, update_replace_policy, condition, metadata)
Attributes¶
Read-only values for get_att(logical_id, attribute). They are not accepted as inputs.
ArnRepositoryUri