aws-cdk-lib.aws_ecr.RepositoryProps

interface RepositoryProps

LanguageType name
.NETAmazon.CDK.AWS.ECR.RepositoryProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecr#RepositoryProps
Javasoftware.amazon.awscdk.services.ecr.RepositoryProps
Pythonaws_cdk.aws_ecr.RepositoryProps
TypeScript (source)aws-cdk-lib » aws_ecr » RepositoryProps

Example

new ecr.Repository(this, 'Repo', { imageTagMutability: ecr.TagMutability.IMMUTABLE });

Properties

NameTypeDescription
autoDeleteImages?booleanWhether all images should be automatically deleted when the repository is removed from the stack or when the stack is deleted.
encryption?RepositoryEncryptionThe kind of server-side encryption to apply to this repository.
encryptionKey?IKeyExternal KMS key to use for repository encryption.
imageScanOnPush?booleanEnable the scan on push when creating the repository.
imageTagMutability?TagMutabilityThe tag mutability setting for the repository.
lifecycleRegistryId?stringThe AWS account ID associated with the registry that contains the repository.
lifecycleRules?LifecycleRule[]Life cycle rules to apply to this registry.
removalPolicy?RemovalPolicyDetermine what happens to the repository when the resource/stack is deleted.
repositoryName?stringName for this repository.

autoDeleteImages?

Type: boolean (optional, default: false)

Whether all images should be automatically deleted when the repository is removed from the stack or when the stack is deleted.

Requires the removalPolicy to be set to RemovalPolicy.DESTROY.


encryption?

Type: RepositoryEncryption (optional, default: KMS if encryptionKey is specified, or AES256 otherwise.)

The kind of server-side encryption to apply to this repository.

If you choose KMS, you can specify a KMS key via encryptionKey. If encryptionKey is not specified, an AWS managed KMS key is used.


encryptionKey?

Type: IKey (optional, default: If encryption is set to KMS and this property is undefined, an AWS managed KMS key is used.)

External KMS key to use for repository encryption.

The 'encryption' property must be either not specified or set to "KMS". An error will be emitted if encryption is set to "AES256".


imageScanOnPush?

Type: boolean (optional, default: false)

Enable the scan on push when creating the repository.


imageTagMutability?

Type: TagMutability (optional, default: TagMutability.MUTABLE)

The tag mutability setting for the repository.

If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.


lifecycleRegistryId?

Type: string (optional, default: The default registry is assumed.)

The AWS account ID associated with the registry that contains the repository.

See also: https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html


lifecycleRules?

Type: LifecycleRule[] (optional, default: No life cycle rules)

Life cycle rules to apply to this registry.


removalPolicy?

Type: RemovalPolicy (optional, default: RemovalPolicy.Retain)

Determine what happens to the repository when the resource/stack is deleted.


repositoryName?

Type: string (optional, default: Automatically generated name.)

Name for this repository.