RepositoryProps

class aws_cdk.aws_ecr.RepositoryProps(*, auto_delete_images=None, empty_on_delete=None, encryption=None, encryption_key=None, image_scan_on_push=None, image_tag_mutability=None, lifecycle_registry_id=None, lifecycle_rules=None, removal_policy=None, repository_name=None)

Bases: object

Parameters:
  • auto_delete_images (Optional[bool]) – (deprecated) 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. Default: false

  • empty_on_delete (Optional[bool]) – If true, deleting the repository force deletes the contents of the repository. If false, the repository must be empty before attempting to delete it. Default: false

  • encryption (Optional[RepositoryEncryption]) – 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. Default: - KMS if encryptionKey is specified, or AES256 otherwise.

  • encryption_key (Optional[IKey]) – 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”. Default: - If encryption is set to KMS and this property is undefined, an AWS managed KMS key is used.

  • image_scan_on_push (Optional[bool]) – Enable the scan on push when creating the repository. Default: false

  • image_tag_mutability (Optional[TagMutability]) – 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. Default: TagMutability.MUTABLE

  • lifecycle_registry_id (Optional[str]) – The AWS account ID associated with the registry that contains the repository. Default: The default registry is assumed.

  • lifecycle_rules (Optional[Sequence[Union[LifecycleRule, Dict[str, Any]]]]) – Life cycle rules to apply to this registry. Default: No life cycle rules

  • removal_policy (Optional[RemovalPolicy]) – Determine what happens to the repository when the resource/stack is deleted. Default: RemovalPolicy.Retain

  • repository_name (Optional[str]) – Name for this repository. The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes. .. epigraph:: If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. Default: Automatically generated name.

ExampleMetadata:

infused

Example:

ecr.Repository(self, "Repo", image_tag_mutability=ecr.TagMutability.IMMUTABLE)

Attributes

auto_delete_images

(deprecated) 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.

Default:

false

Deprecated:

Use emptyOnDelete instead.

Stability:

deprecated

empty_on_delete

If true, deleting the repository force deletes the contents of the repository.

If false, the repository must be empty before attempting to delete it.

Default:

false

encryption

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.

Default:
  • KMS if encryptionKey is specified, or AES256 otherwise.

encryption_key

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”.

Default:

  • If encryption is set to KMS and this property is undefined,

an AWS managed KMS key is used.

image_scan_on_push

Enable the scan on push when creating the repository.

Default:

false

image_tag_mutability

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.

Default:

TagMutability.MUTABLE

lifecycle_registry_id

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

Default:

The default registry is assumed.

See:

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

lifecycle_rules

Life cycle rules to apply to this registry.

Default:

No life cycle rules

removal_policy

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

Default:

RemovalPolicy.Retain

repository_name

Name for this repository.

The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes. .. epigraph:

If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
Default:

Automatically generated name.