Class CfnRepository
- All Implemented Interfaces:
IInspectable,IRepositoryRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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")
.emptyOnDelete(false)
.encryptionConfiguration(EncryptionConfigurationProperty.builder()
.encryptionType("encryptionType")
// the properties below are optional
.kmsKey("kmsKey")
.build())
.imageScanningConfiguration(ImageScanningConfigurationProperty.builder()
.scanOnPush(false)
.build())
.imageTagMutability("imageTagMutability")
.imageTagMutabilityExclusionFilters(List.of(ImageTagMutabilityExclusionFilterProperty.builder()
.imageTagMutabilityExclusionFilterType("imageTagMutabilityExclusionFilterType")
.imageTagMutabilityExclusionFilterValue("imageTagMutabilityExclusionFilterValue")
.build()))
.lifecyclePolicy(LifecyclePolicyProperty.builder()
.lifecyclePolicyText("lifecyclePolicyText")
.registryId("registryId")
.build())
.repositoryName("repositoryName")
.repositoryPolicyText(repositoryPolicyText)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
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 interfaceA filter that specifies which image tags should be excluded from the repository's image tag mutability setting.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.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.ecr.IRepositoryRef
IRepositoryRef.Jsii$Default, IRepositoryRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnRepository(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnRepository(software.amazon.jsii.JsiiObjectRef objRef) CfnRepository(software.constructs.Construct scope, String id) Create a newAWS::ECR::Repository.CfnRepository(software.constructs.Construct scope, String id, CfnRepositoryProps props) Create a newAWS::ECR::Repository. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForRepository(IRepositoryRef resource) static IRepositoryReffromRepositoryArn(software.constructs.Construct scope, String id, String arn) Creates a new IRepositoryRef from an ARN.static IRepositoryReffromRepositoryName(software.constructs.Construct scope, String id, String repositoryName) Creates a new IRepositoryRef from a repositoryName.Returns the Amazon Resource Name (ARN) for the specifiedAWS::ECR::Repositoryresource.Returns the URI for the specifiedAWS::ECR::Repositoryresource.If true, deleting the repository force deletes the contents of the repository.The encryption configuration for the repository.The tag mutability setting for the repository.A list of filters that specify which image tags are excluded from the repository's image tag mutability setting.Creates or updates a lifecycle policy.The name to use for the repository.The JSON repository policy text to apply to the repository.A reference to a Repository resource.getTags()Tag Manager which manages the tags for this resource.An array of key-value pairs to apply to this resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnRepository.renderProperties(Map<String, Object> props) voidsetEmptyOnDelete(Boolean value) If true, deleting the repository force deletes the contents of the repository.voidsetEmptyOnDelete(IResolvable value) If true, deleting the repository force deletes the contents of the repository.voidThe encryption configuration for the repository.voidThe encryption configuration for the repository.voidvoidvoidsetImageTagMutability(String value) The tag mutability setting for the repository.voidA list of filters that specify which image tags are excluded from the repository's image tag mutability setting.voidA list of filters that specify which image tags are excluded from the repository's image tag mutability setting.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.voidsetTagsRaw(List<CfnTag> value) An array of key-value pairs to apply to this resource.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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 software.constructs.Construct scope, @NotNull String id, @Nullable CfnRepositoryProps props) Create a newAWS::ECR::Repository.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties.
-
CfnRepository
@Stability(Stable) public CfnRepository(@NotNull software.constructs.Construct scope, @NotNull String id) Create a newAWS::ECR::Repository.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
arnForRepository
- Parameters:
resource- This parameter is required.
-
fromRepositoryArn
@Stability(Stable) @NotNull public static IRepositoryRef fromRepositoryArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String arn) Creates a new IRepositoryRef from an ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.arn- This parameter is required.
-
fromRepositoryName
@Stability(Stable) @NotNull public static IRepositoryRef fromRepositoryName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String repositoryName) Creates a new IRepositoryRef from a repositoryName.- Parameters:
scope- This parameter is required.id- This parameter is required.repositoryName- This parameter is required.
-
isCfnRepository
Checks whether the given object is a CfnRepository.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
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
-
getRepositoryRef
A reference to a Repository resource.- Specified by:
getRepositoryRefin interfaceIRepositoryRef
-
getTags
Tag Manager which manages the tags for this resource. -
getEmptyOnDelete
If true, deleting the repository force deletes the contents of the repository.Returns union: either
BooleanorIResolvable -
setEmptyOnDelete
If true, deleting the repository force deletes the contents of the repository. -
setEmptyOnDelete
If true, deleting the repository force deletes the contents of the repository. -
getEncryptionConfiguration
The encryption configuration for the repository.Returns union: either
IResolvableorCfnRepository.EncryptionConfigurationProperty -
setEncryptionConfiguration
The encryption configuration for the repository. -
setEncryptionConfiguration
@Stability(Stable) public void setEncryptionConfiguration(@Nullable CfnRepository.EncryptionConfigurationProperty value) The encryption configuration for the repository. -
getImageScanningConfiguration
The
imageScanningConfigurationparameter is being deprecated, in favor of specifying the image scanning configuration at the registry level.Returns union: either
IResolvableorCfnRepository.ImageScanningConfigurationProperty -
setImageScanningConfiguration
The
imageScanningConfigurationparameter is being deprecated, in favor of specifying the image scanning configuration at the registry level. -
setImageScanningConfiguration
@Stability(Stable) public void setImageScanningConfiguration(@Nullable CfnRepository.ImageScanningConfigurationProperty value) The
imageScanningConfigurationparameter is being deprecated, in favor of specifying the image scanning configuration at the registry level. -
getImageTagMutability
The tag mutability setting for the repository. -
setImageTagMutability
The tag mutability setting for the repository. -
getImageTagMutabilityExclusionFilters
A list of filters that specify which image tags are excluded from the repository's image tag mutability setting.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnRepository.ImageTagMutabilityExclusionFilterProperty> -
setImageTagMutabilityExclusionFilters
A list of filters that specify which image tags are excluded from the repository's image tag mutability setting. -
setImageTagMutabilityExclusionFilters
A list of filters that specify which image tags are excluded from the repository's image tag mutability setting. -
getLifecyclePolicy
Creates or updates a lifecycle policy.Returns union: either
IResolvableorCfnRepository.LifecyclePolicyProperty -
setLifecyclePolicy
Creates or updates a lifecycle policy. -
setLifecyclePolicy
@Stability(Stable) public void setLifecyclePolicy(@Nullable CfnRepository.LifecyclePolicyProperty value) Creates or updates a lifecycle policy. -
getRepositoryName
The name to use for the repository. -
setRepositoryName
The name to use for the repository. -
getRepositoryPolicyText
The JSON repository policy text to apply to the repository. -
setRepositoryPolicyText
The JSON repository policy text to apply to the repository. -
getTagsRaw
An array of key-value pairs to apply to this resource. -
setTagsRaw
An array of key-value pairs to apply to this resource.
-