@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.534Z") @Stability(value=Stable) public class CfnRepository extends CfnResource implements IInspectable
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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnRepository.Builder
A fluent builder for
CfnRepository. |
static interface |
CfnRepository.EncryptionConfigurationProperty
The encryption configuration for the repository.
|
static interface |
CfnRepository.ImageScanningConfigurationProperty
The image scanning configuration for a repository.
|
static interface |
CfnRepository.LifecyclePolicyProperty
The `LifecyclePolicy` property type specifies a lifecycle policy.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnRepository(software.constructs.Construct scope,
String id)
Create a new `AWS::ECR::Repository`.
|
|
CfnRepository(software.constructs.Construct scope,
String id,
CfnRepositoryProps props)
Create a new `AWS::ECR::Repository`.
|
protected |
CfnRepository(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnRepository(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrArn()
Returns the Amazon Resource Name (ARN) for the specified `AWS::ECR::Repository` resource.
|
String |
getAttrRepositoryUri()
Returns the URI for the specified `AWS::ECR::Repository` resource.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getEncryptionConfiguration()
The encryption configuration for the repository.
|
Object |
getImageScanningConfiguration()
The image scanning configuration for the repository.
|
String |
getImageTagMutability()
The tag mutability setting for the repository.
|
Object |
getLifecyclePolicy()
Creates or updates a lifecycle policy.
|
String |
getRepositoryName()
The name to use for the repository.
|
Object |
getRepositoryPolicyText()
The JSON repository policy text to apply to the repository.
|
TagManager |
getTags()
An array of key-value pairs to apply to this resource.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setEncryptionConfiguration(CfnRepository.EncryptionConfigurationProperty value)
The encryption configuration for the repository.
|
void |
setEncryptionConfiguration(IResolvable value)
The encryption configuration for the repository.
|
void |
setImageScanningConfiguration(CfnRepository.ImageScanningConfigurationProperty value)
The image scanning configuration for the repository.
|
void |
setImageScanningConfiguration(IResolvable value)
The image scanning configuration for the repository.
|
void |
setImageTagMutability(String value)
The tag mutability setting for the repository.
|
void |
setLifecyclePolicy(CfnRepository.LifecyclePolicyProperty value)
Creates or updates a lifecycle policy.
|
void |
setLifecyclePolicy(IResolvable value)
Creates or updates a lifecycle policy.
|
void |
setRepositoryName(String value)
The name to use for the repository.
|
void |
setRepositoryPolicyText(Object value)
The JSON repository policy text to apply to the repository.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnRepository(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnRepository(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnRepository(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
CfnRepositoryProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties.@Stability(value=Stable)
public CfnRepository(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrArn()
For example, arn:aws:ecr: *eu-west-1* : *123456789012* :repository/ *test-repository* .
@Stability(value=Stable) @NotNull public String getAttrRepositoryUri()
For example, *123456789012* .dkr.ecr. *us-west-2* .amazonaws.com/repository .
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public Object getRepositoryPolicyText()
For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide .
@Stability(value=Stable)
public void setRepositoryPolicyText(@NotNull
Object value)
For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide .
@Stability(value=Stable) @Nullable public Object getEncryptionConfiguration()
This determines how the contents of your repository are encrypted at rest.
@Stability(value=Stable)
public void setEncryptionConfiguration(@Nullable
CfnRepository.EncryptionConfigurationProperty value)
This determines how the contents of your repository are encrypted at rest.
@Stability(value=Stable)
public void setEncryptionConfiguration(@Nullable
IResolvable value)
This determines how the contents of your repository are encrypted at rest.
@Stability(value=Stable) @Nullable public Object getImageScanningConfiguration()
This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
@Stability(value=Stable)
public void setImageScanningConfiguration(@Nullable
CfnRepository.ImageScanningConfigurationProperty value)
This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
@Stability(value=Stable)
public void setImageScanningConfiguration(@Nullable
IResolvable value)
This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
@Stability(value=Stable) @Nullable public String getImageTagMutability()
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.
@Stability(value=Stable)
public void setImageTagMutability(@Nullable
String value)
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.
@Stability(value=Stable) @Nullable public Object getLifecyclePolicy()
For information about lifecycle policy syntax, see Lifecycle policy template .
@Stability(value=Stable)
public void setLifecyclePolicy(@Nullable
CfnRepository.LifecyclePolicyProperty value)
For information about lifecycle policy syntax, see Lifecycle policy template .
@Stability(value=Stable)
public void setLifecyclePolicy(@Nullable
IResolvable value)
For information about lifecycle policy syntax, see Lifecycle policy template .
@Stability(value=Stable) @Nullable public String getRepositoryName()
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 .
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.
@Stability(value=Stable)
public void setRepositoryName(@Nullable
String value)
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 .
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.
Copyright © 2022. All rights reserved.