Class CfnRepository
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::ECR::Repository.
The AWS::ECR::Repository resource 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 .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecr.*;
Object repositoryPolicyText;
CfnRepository cfnRepository = CfnRepository.Builder.create(this, "MyCfnRepository")
.encryptionConfiguration(EncryptionConfigurationProperty.builder()
.encryptionType("encryptionType")
// the properties below are optional
.kmsKey("kmsKey")
.build())
.imageScanningConfiguration(ImageScanningConfigurationProperty.builder()
.scanOnPush(false)
.build())
.imageTagMutability("imageTagMutability")
.lifecyclePolicy(LifecyclePolicyProperty.builder()
.lifecyclePolicyText("lifecyclePolicyText")
.registryId("registryId")
.build())
.repositoryName("repositoryName")
.repositoryPolicyText(repositoryPolicyText)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnRepository.static interfaceThe encryption configuration for the repository.static interfaceThe image scanning configuration for a repository.static interfaceTheLifecyclePolicyproperty type specifies a lifecycle policy.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnRepository(Construct scope, String id) Create a newAWS::ECR::Repository.CfnRepository(Construct scope, String id, CfnRepositoryProps props) Create a newAWS::ECR::Repository.protectedCfnRepository(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnRepository(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionReturns the Amazon Resource Name (ARN) for the specifiedAWS::ECR::Repositoryresource.Returns the URI for the specifiedAWS::ECR::Repositoryresource.The encryption configuration for the repository.The image scanning configuration for the repository.The tag mutability setting for the repository.Creates or updates a lifecycle policy.The name to use for the repository.The JSON repository policy text to apply to the repository.getTags()An array of key-value pairs to apply to this resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidThe encryption configuration for the repository.voidThe encryption configuration for the repository.voidThe image scanning configuration for the repository.voidThe image scanning configuration for the repository.voidsetImageTagMutability(String value) The tag mutability setting for the repository.voidsetLifecyclePolicy(IResolvable value) Creates or updates a lifecycle policy.voidCreates or updates a lifecycle policy.voidsetRepositoryName(String value) The name to use for the repository.voidsetRepositoryPolicyText(Object value) The JSON repository policy text to apply to the repository.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnRepository
protected CfnRepository(software.amazon.jsii.JsiiObjectRef objRef) -
CfnRepository
protected CfnRepository(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnRepository
@Stability(Stable) public CfnRepository(@NotNull Construct scope, @NotNull String id, @Nullable CfnRepositoryProps props) Create a newAWS::ECR::Repository.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
CfnRepository
Create a newAWS::ECR::Repository.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
Returns the Amazon Resource Name (ARN) for the specifiedAWS::ECR::Repositoryresource.For example,
arn:aws:ecr: *eu-west-1* : *123456789012* :repository/ *test-repository*. -
getAttrRepositoryUri
Returns the URI for the specifiedAWS::ECR::Repositoryresource.For example,
*123456789012* .dkr.ecr. *us-west-2* .amazonaws.com/repository. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
An array of key-value pairs to apply to this resource. -
getRepositoryPolicyText
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 .
-
setRepositoryPolicyText
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 .
-
getEncryptionConfiguration
The encryption configuration for the repository.This determines how the contents of your repository are encrypted at rest.
-
setEncryptionConfiguration
The encryption configuration for the repository.This determines how the contents of your repository are encrypted at rest.
-
setEncryptionConfiguration
@Stability(Stable) public void setEncryptionConfiguration(@Nullable CfnRepository.EncryptionConfigurationProperty value) The encryption configuration for the repository.This determines how the contents of your repository are encrypted at rest.
-
getImageScanningConfiguration
The image scanning configuration for the repository.This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
-
setImageScanningConfiguration
The image scanning configuration for the repository.This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
-
setImageScanningConfiguration
@Stability(Stable) public void setImageScanningConfiguration(@Nullable CfnRepository.ImageScanningConfigurationProperty value) The image scanning configuration for the repository.This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
-
getImageTagMutability
The tag mutability setting for the repository.If this parameter is omitted, the default setting of
MUTABLEwill be used which will allow image tags to be overwritten. IfIMMUTABLEis specified, all image tags within the repository will be immutable which will prevent them from being overwritten. -
setImageTagMutability
The tag mutability setting for the repository.If this parameter is omitted, the default setting of
MUTABLEwill be used which will allow image tags to be overwritten. IfIMMUTABLEis specified, all image tags within the repository will be immutable which will prevent them from being overwritten. -
getLifecyclePolicy
Creates or updates a lifecycle policy.For information about lifecycle policy syntax, see Lifecycle policy template .
-
setLifecyclePolicy
Creates or updates a lifecycle policy.For information about lifecycle policy syntax, see Lifecycle policy template .
-
setLifecyclePolicy
@Stability(Stable) public void setLifecyclePolicy(@Nullable CfnRepository.LifecyclePolicyProperty value) Creates or updates a lifecycle policy.For information about lifecycle policy syntax, see Lifecycle policy template .
-
getRepositoryName
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 asproject-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.
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.
-
setRepositoryName
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 asproject-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.
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.
-