Class RepositoryProps.Builder
java.lang.Object
software.amazon.awscdk.services.ecr.RepositoryProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<RepositoryProps>
- Enclosing interface:
RepositoryProps
@Stability(Stable)
public static final class RepositoryProps.Builder
extends Object
implements software.amazon.jsii.Builder<RepositoryProps>
A builder for
RepositoryProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionautoDeleteImages
(Boolean autoDeleteImages) Deprecated.Use `emptyOnDelete` instead.build()
Builds the configured instance.emptyOnDelete
(Boolean emptyOnDelete) Sets the value ofRepositoryProps.getEmptyOnDelete()
encryption
(RepositoryEncryption encryption) Sets the value ofRepositoryProps.getEncryption()
encryptionKey
(IKey encryptionKey) Sets the value ofRepositoryProps.getEncryptionKey()
imageScanOnPush
(Boolean imageScanOnPush) Sets the value ofRepositoryProps.getImageScanOnPush()
imageTagMutability
(TagMutability imageTagMutability) Sets the value ofRepositoryProps.getImageTagMutability()
lifecycleRegistryId
(String lifecycleRegistryId) Sets the value ofRepositoryProps.getLifecycleRegistryId()
lifecycleRules
(List<? extends LifecycleRule> lifecycleRules) Sets the value ofRepositoryProps.getLifecycleRules()
removalPolicy
(RemovalPolicy removalPolicy) Sets the value ofRepositoryProps.getRemovalPolicy()
repositoryName
(String repositoryName) Sets the value ofRepositoryProps.getRepositoryName()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
autoDeleteImages
@Stability(Deprecated) @Deprecated public RepositoryProps.Builder autoDeleteImages(Boolean autoDeleteImages) Deprecated.Use `emptyOnDelete` instead.Sets the value ofRepositoryProps.getAutoDeleteImages()
- Parameters:
autoDeleteImages
- Whether all images should be automatically deleted when the repository is removed from the stack or when the stack is deleted. Requires theremovalPolicy
to be set toRemovalPolicy.DESTROY
.- Returns:
this
-
emptyOnDelete
Sets the value ofRepositoryProps.getEmptyOnDelete()
- Parameters:
emptyOnDelete
- If true, deleting the repository force deletes the contents of the repository. If false, the repository must be empty before attempting to delete it.- Returns:
this
-
encryption
Sets the value ofRepositoryProps.getEncryption()
- Parameters:
encryption
- The kind of server-side encryption to apply to this repository. If you choose KMS, you can specify a KMS key viaencryptionKey
. If encryptionKey is not specified, an AWS managed KMS key is used.- Returns:
this
-
encryptionKey
Sets the value ofRepositoryProps.getEncryptionKey()
- Parameters:
encryptionKey
- External KMS key to use for repository encryption. The 'encryption' property must be either not specified or set to "KMS". An error will be emitted if encryption is set to "AES256".- Returns:
this
-
imageScanOnPush
Sets the value ofRepositoryProps.getImageScanOnPush()
- Parameters:
imageScanOnPush
- Enable the scan on push when creating the repository.- Returns:
this
-
imageTagMutability
@Stability(Stable) public RepositoryProps.Builder imageTagMutability(TagMutability imageTagMutability) Sets the value ofRepositoryProps.getImageTagMutability()
- Parameters:
imageTagMutability
- 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.- Returns:
this
-
lifecycleRegistryId
Sets the value ofRepositoryProps.getLifecycleRegistryId()
- Parameters:
lifecycleRegistryId
- The AWS account ID associated with the registry that contains the repository.- Returns:
this
-
lifecycleRules
@Stability(Stable) public RepositoryProps.Builder lifecycleRules(List<? extends LifecycleRule> lifecycleRules) Sets the value ofRepositoryProps.getLifecycleRules()
- Parameters:
lifecycleRules
- Life cycle rules to apply to this registry.- Returns:
this
-
removalPolicy
Sets the value ofRepositoryProps.getRemovalPolicy()
- Parameters:
removalPolicy
- Determine what happens to the repository when the resource/stack is deleted.- Returns:
this
-
repositoryName
Sets the value ofRepositoryProps.getRepositoryName()
- Parameters:
repositoryName
- Name for this repository. 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.
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<RepositoryProps>
- Returns:
- a new instance of
RepositoryProps
- Throws:
NullPointerException
- if any required attribute was not provided
-