RepositoryProps

class aws_cdk.aws_ecr.RepositoryProps(*, 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:
  • 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. Default: Automatically generated name.

ExampleMetadata:

infused

Example:

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

Attributes

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.

Default:

Automatically generated name.