CfnRepositoryProps

class aws_cdk.aws_ecr.CfnRepositoryProps(*, empty_on_delete=None, encryption_configuration=None, image_scanning_configuration=None, image_tag_mutability=None, lifecycle_policy=None, repository_name=None, repository_policy_text=None, tags=None)

Bases: object

Properties for defining a CfnRepository.

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

  • encryption_configuration (Union[IResolvable, EncryptionConfigurationProperty, Dict[str, Any], None]) – The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.

  • image_scanning_configuration (Union[IResolvable, ImageScanningConfigurationProperty, Dict[str, Any], None]) – The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.

  • image_tag_mutability (Optional[str]) – 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. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.

  • lifecycle_policy (Union[IResolvable, LifecyclePolicyProperty, Dict[str, Any], None]) – Creates or updates a lifecycle policy. For information about lifecycle policy syntax, see Lifecycle policy template .

  • repository_name (Optional[str]) – 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 as project-a/nginx-web-app ). If you don’t specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the repository name. For more information, see Name type . 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.

  • repository_policy_text (Optional[Any]) – The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide .

  • tags (Optional[Sequence[Union[CfnTag, Dict[str, Any]]]]) – An array of key-value pairs to apply to this resource.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecr as ecr

# repository_policy_text: Any

cfn_repository_props = ecr.CfnRepositoryProps(
    empty_on_delete=False,
    encryption_configuration=ecr.CfnRepository.EncryptionConfigurationProperty(
        encryption_type="encryptionType",

        # the properties below are optional
        kms_key="kmsKey"
    ),
    image_scanning_configuration=ecr.CfnRepository.ImageScanningConfigurationProperty(
        scan_on_push=False
    ),
    image_tag_mutability="imageTagMutability",
    lifecycle_policy=ecr.CfnRepository.LifecyclePolicyProperty(
        lifecycle_policy_text="lifecyclePolicyText",
        registry_id="registryId"
    ),
    repository_name="repositoryName",
    repository_policy_text=repository_policy_text,
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)

Attributes

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-emptyondelete

encryption_configuration

The encryption configuration for the repository.

This determines how the contents of your repository are encrypted at rest.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration

image_scanning_configuration

The image scanning configuration for the repository.

This determines whether images are scanned for known vulnerabilities after being pushed to the repository.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration

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. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability

lifecycle_policy

Creates or updates a lifecycle policy.

For information about lifecycle policy syntax, see Lifecycle policy template .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy

repository_name

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 as project-a/nginx-web-app ). If you don’t specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the repository name. For more information, see Name type .

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.
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname

repository_policy_text

The JSON repository policy text to apply to the repository.

For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext

tags

An array of key-value pairs to apply to this resource.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags