Class Repository.Builder

java.lang.Object
software.amazon.awscdk.services.ecr.Repository.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Repository>
Enclosing class:
Repository

@Stability(Stable) public static final class Repository.Builder extends Object implements software.amazon.jsii.Builder<Repository>
A fluent builder for Repository.
  • Method Details

    • create

      @Stability(Stable) public static Repository.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Repository.Builder.
    • autoDeleteImages

      @Stability(Deprecated) @Deprecated public Repository.Builder autoDeleteImages(Boolean autoDeleteImages)
      Deprecated.
      Use emptyOnDelete instead.
      (deprecated) Whether all images should be automatically deleted when the repository is removed from the stack or when the stack is deleted.

      Requires the removalPolicy to be set to RemovalPolicy.DESTROY.

      Default: false

      Parameters:
      autoDeleteImages - Whether all images should be automatically deleted when the repository is removed from the stack or when the stack is deleted. This parameter is required.
      Returns:
      this
    • emptyOnDelete

      @Stability(Stable) public Repository.Builder emptyOnDelete(Boolean 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.

      Default: false

      Parameters:
      emptyOnDelete - If true, deleting the repository force deletes the contents of the repository. This parameter is required.
      Returns:
      this
    • encryption

      @Stability(Stable) public Repository.Builder encryption(RepositoryEncryption encryption)
      The kind of server-side encryption to apply to this repository.

      If you choose KMS, you can specify a KMS key via encryptionKey. If encryptionKey is not specified, an AWS managed KMS key is used.

      Default: - `KMS` if `encryptionKey` is specified, or `AES256` otherwise.

      Parameters:
      encryption - The kind of server-side encryption to apply to this repository. This parameter is required.
      Returns:
      this
    • encryptionKey

      @Stability(Stable) public Repository.Builder encryptionKey(IKey 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".

      Default: - If encryption is set to `KMS` and this property is undefined, an AWS managed KMS key is used.

      Parameters:
      encryptionKey - External KMS key to use for repository encryption. This parameter is required.
      Returns:
      this
    • imageScanOnPush

      @Stability(Stable) public Repository.Builder imageScanOnPush(Boolean imageScanOnPush)
      Enable the scan on push when creating the repository.

      Default: false

      Parameters:
      imageScanOnPush - Enable the scan on push when creating the repository. This parameter is required.
      Returns:
      this
    • imageTagMutability

      @Stability(Stable) public Repository.Builder imageTagMutability(TagMutability 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.

      Default: TagMutability.MUTABLE

      Parameters:
      imageTagMutability - The tag mutability setting for the repository. This parameter is required.
      Returns:
      this
    • lifecycleRegistryId

      @Stability(Stable) public Repository.Builder lifecycleRegistryId(String lifecycleRegistryId)
      The AWS account ID associated with the registry that contains the repository.

      Default: The default registry is assumed.

      Parameters:
      lifecycleRegistryId - The AWS account ID associated with the registry that contains the repository. This parameter is required.
      Returns:
      this
      See Also:
    • lifecycleRules

      @Stability(Stable) public Repository.Builder lifecycleRules(List<? extends LifecycleRule> lifecycleRules)
      Life cycle rules to apply to this registry.

      Default: No life cycle rules

      Parameters:
      lifecycleRules - Life cycle rules to apply to this registry. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public Repository.Builder removalPolicy(RemovalPolicy removalPolicy)
      Determine what happens to the repository when the resource/stack is deleted.

      Default: RemovalPolicy.Retain

      Parameters:
      removalPolicy - Determine what happens to the repository when the resource/stack is deleted. This parameter is required.
      Returns:
      this
    • repositoryName

      @Stability(Stable) public Repository.Builder repositoryName(String 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.

      Default: Automatically generated name.

      Parameters:
      repositoryName - Name for this repository. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Repository build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Repository>
      Returns:
      a newly built instance of Repository.