CfnRepositoryPropsMixin
- class aws_cdk.mixins_preview.aws_ecr.mixins.CfnRepositoryPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::ECR::Repositoryresource specifies an Amazon Elastic Container Registry (Amazon ECR) repository, where users can push and pull Docker images, Open Container Initiative (OCI) images, and OCI compatible artifacts.For more information, see Amazon ECR private repositories in the Amazon ECR User Guide .
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html
- CloudformationResource:
AWS::ECR::Repository
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
from aws_cdk import CfnTag # The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_ecr import mixins as ecr_mixins # repository_policy_text: Any cfn_repository_props_mixin = ecr_mixins.CfnRepositoryPropsMixin(ecr_mixins.CfnRepositoryMixinProps( empty_on_delete=False, encryption_configuration=ecr_mixins.CfnRepositoryPropsMixin.EncryptionConfigurationProperty( encryption_type="encryptionType", kms_key="kmsKey" ), image_scanning_configuration=ecr_mixins.CfnRepositoryPropsMixin.ImageScanningConfigurationProperty( scan_on_push=False ), image_tag_mutability="imageTagMutability", image_tag_mutability_exclusion_filters=[ecr_mixins.CfnRepositoryPropsMixin.ImageTagMutabilityExclusionFilterProperty( image_tag_mutability_exclusion_filter_type="imageTagMutabilityExclusionFilterType", image_tag_mutability_exclusion_filter_value="imageTagMutabilityExclusionFilterValue" )], lifecycle_policy=ecr_mixins.CfnRepositoryPropsMixin.LifecyclePolicyProperty( lifecycle_policy_text="lifecyclePolicyText", registry_id="registryId" ), repository_name="repositoryName", repository_policy_text=repository_policy_text, tags=[CfnTag( key="key", value="value" )] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::ECR::Repository.- Parameters:
props (
Union[CfnRepositoryMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['emptyOnDelete', 'encryptionConfiguration', 'imageScanningConfiguration', 'imageTagMutability', 'imageTagMutabilityExclusionFilters', 'lifecyclePolicy', 'repositoryName', 'repositoryPolicyText', 'tags']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
EncryptionConfigurationProperty
- class CfnRepositoryPropsMixin.EncryptionConfigurationProperty(*, encryption_type=None, kms_key=None)
Bases:
objectThe encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
By default, when no encryption configuration is set or the
AES256encryption type is used, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts your data at rest using an AES256 encryption algorithm. This does not require any action on your part.For more control over the encryption of the contents of your repository, you can use server-side encryption with AWS Key Management Service key stored in AWS Key Management Service ( AWS ) to encrypt your images. For more information, see Amazon ECR encryption at rest in the Amazon Elastic Container Registry User Guide .
- Parameters:
encryption_type (
Optional[str]) –The encryption type to use. If you use the
KMSencryption type, the contents of the repository will be encrypted using server-side encryption with AWS Key Management Service key stored in AWS . When you use AWS to encrypt your data, you can either use the default AWS managed AWS key for Amazon ECR, or specify your own AWS key, which you already created. If you use theKMS_DSSEencryption type, the contents of the repository will be encrypted with two layers of encryption using server-side encryption with the AWS Management Service key stored in AWS . Similar to theKMSencryption type, you can either use the default AWS managed AWS key for Amazon ECR, or specify your own AWS key, which you’ve already created. If you use theAES256encryption type, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES256 encryption algorithm. For more information, see Amazon ECR encryption at rest in the Amazon Elastic Container Registry User Guide .kms_key (
Optional[str]) – If you use theKMSencryption type, specify the AWS key to use for encryption. The alias, key ID, or full ARN of the AWS key can be specified. The key must exist in the same Region as the repository. If no key is specified, the default AWS managed AWS key for Amazon ECR will be used.
- See:
- 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.mixins_preview.aws_ecr import mixins as ecr_mixins encryption_configuration_property = ecr_mixins.CfnRepositoryPropsMixin.EncryptionConfigurationProperty( encryption_type="encryptionType", kms_key="kmsKey" )
Attributes
- encryption_type
The encryption type to use.
If you use the
KMSencryption type, the contents of the repository will be encrypted using server-side encryption with AWS Key Management Service key stored in AWS . When you use AWS to encrypt your data, you can either use the default AWS managed AWS key for Amazon ECR, or specify your own AWS key, which you already created.If you use the
KMS_DSSEencryption type, the contents of the repository will be encrypted with two layers of encryption using server-side encryption with the AWS Management Service key stored in AWS . Similar to theKMSencryption type, you can either use the default AWS managed AWS key for Amazon ECR, or specify your own AWS key, which you’ve already created.If you use the
AES256encryption type, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES256 encryption algorithm.For more information, see Amazon ECR encryption at rest in the Amazon Elastic Container Registry User Guide .
- kms_key
If you use the
KMSencryption type, specify the AWS key to use for encryption.The alias, key ID, or full ARN of the AWS key can be specified. The key must exist in the same Region as the repository. If no key is specified, the default AWS managed AWS key for Amazon ECR will be used.
ImageScanningConfigurationProperty
- class CfnRepositoryPropsMixin.ImageScanningConfigurationProperty(*, scan_on_push=None)
Bases:
objectThe image scanning configuration for a repository.
- Parameters:
scan_on_push (
Union[bool,IResolvable,None]) – The setting that determines whether images are scanned after being pushed to a repository. If set totrue, images will be scanned after being pushed. If this parameter is not specified, it will default tofalseand images will not be scanned unless a scan is manually started.- See:
- 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.mixins_preview.aws_ecr import mixins as ecr_mixins image_scanning_configuration_property = ecr_mixins.CfnRepositoryPropsMixin.ImageScanningConfigurationProperty( scan_on_push=False )
Attributes
- scan_on_push
The setting that determines whether images are scanned after being pushed to a repository.
If set to
true, images will be scanned after being pushed. If this parameter is not specified, it will default tofalseand images will not be scanned unless a scan is manually started.
ImageTagMutabilityExclusionFilterProperty
- class CfnRepositoryPropsMixin.ImageTagMutabilityExclusionFilterProperty(*, image_tag_mutability_exclusion_filter_type=None, image_tag_mutability_exclusion_filter_value=None)
Bases:
objectA filter that specifies which image tags should be excluded from the repository’s image tag mutability setting.
- Parameters:
image_tag_mutability_exclusion_filter_type (
Optional[str]) – Specifies the type of filter to use for excluding image tags from the repository’s mutability setting.image_tag_mutability_exclusion_filter_value (
Optional[str]) – The value to use when filtering image tags.
- See:
- 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.mixins_preview.aws_ecr import mixins as ecr_mixins image_tag_mutability_exclusion_filter_property = ecr_mixins.CfnRepositoryPropsMixin.ImageTagMutabilityExclusionFilterProperty( image_tag_mutability_exclusion_filter_type="imageTagMutabilityExclusionFilterType", image_tag_mutability_exclusion_filter_value="imageTagMutabilityExclusionFilterValue" )
Attributes
- image_tag_mutability_exclusion_filter_type
Specifies the type of filter to use for excluding image tags from the repository’s mutability setting.
- image_tag_mutability_exclusion_filter_value
The value to use when filtering image tags.
LifecyclePolicyProperty
- class CfnRepositoryPropsMixin.LifecyclePolicyProperty(*, lifecycle_policy_text=None, registry_id=None)
Bases:
objectThe
LifecyclePolicyproperty type specifies a lifecycle policy.For information about lifecycle policy syntax, see Lifecycle policy template in the Amazon ECR User Guide .
- Parameters:
lifecycle_policy_text (
Optional[str]) – The JSON repository policy text to apply to the repository.registry_id (
Optional[str]) – The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
- See:
- 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.mixins_preview.aws_ecr import mixins as ecr_mixins lifecycle_policy_property = ecr_mixins.CfnRepositoryPropsMixin.LifecyclePolicyProperty( lifecycle_policy_text="lifecyclePolicyText", registry_id="registryId" )
Attributes
- lifecycle_policy_text
The JSON repository policy text to apply to the repository.
- registry_id
The AWS account ID associated with the registry that contains the repository.
If you do not specify a registry, the default registry is assumed.