Class SecretProps.Builder

java.lang.Object
software.amazon.awscdk.services.secretsmanager.SecretProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<SecretProps>
Enclosing interface:
SecretProps

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

    • Builder

      public Builder()
  • Method Details

    • description

      @Stability(Stable) public SecretProps.Builder description(String description)
      Parameters:
      description - An optional, human-friendly description of the secret.
      Returns:
      this
    • encryptionKey

      @Stability(Stable) public SecretProps.Builder encryptionKey(IKey encryptionKey)
      Parameters:
      encryptionKey - The customer-managed encryption key to use for encrypting the secret value.
      Returns:
      this
    • generateSecretString

      @Stability(Stable) public SecretProps.Builder generateSecretString(SecretStringGenerator generateSecretString)
      Parameters:
      generateSecretString - Configuration for how to generate a secret value. Only one of secretString and generateSecretString can be provided.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public SecretProps.Builder removalPolicy(RemovalPolicy removalPolicy)
      Parameters:
      removalPolicy - Policy to apply when the secret is removed from this stack.
      Returns:
      this
    • replicaRegions

      @Stability(Stable) public SecretProps.Builder replicaRegions(List<? extends ReplicaRegion> replicaRegions)
      Parameters:
      replicaRegions - A list of regions where to replicate this secret.
      Returns:
      this
    • secretName

      @Stability(Stable) public SecretProps.Builder secretName(String secretName)
      Sets the value of SecretProps.getSecretName()
      Parameters:
      secretName - A name for the secret. Note that deleting secrets from SecretsManager does not happen immediately, but after a 7 to 30 days blackout period. During that period, it is not possible to create another secret that shares the same name.
      Returns:
      this
    • secretObjectValue

      @Stability(Stable) public SecretProps.Builder secretObjectValue(Map<String,? extends SecretValue> secretObjectValue)
      Parameters:
      secretObjectValue - Initial value for a JSON secret. NOTE: *It is highly encouraged to leave this field undefined and allow SecretsManager to create the secret value. The secret object -- if provided -- will be included in the output of the cdk as part of synthesis, and will appear in the CloudFormation template in the console. This can be secure(-ish) if that value is merely reference to another resource (or one of its attributes), but if the value is a plaintext string, it will be visible to anyone with access to the CloudFormation template (via the AWS Console, SDKs, or CLI).

      Specifies a JSON object that you want to encrypt and store in this new version of the secret. To specify a simple string value instead, use SecretProps.secretStringValue

      Only one of secretStringBeta1, secretStringValue, 'secretObjectValue', and generateSecretString can be provided.

      Returns:
      this
    • secretStringBeta1

      @Stability(Deprecated) @Deprecated public SecretProps.Builder secretStringBeta1(SecretStringValueBeta1 secretStringBeta1)
      Deprecated.
      Use `secretStringValue` instead.
      Parameters:
      secretStringBeta1 - Initial value for the secret. NOTE: *It is highly encouraged to leave this field undefined and allow SecretsManager to create the secret value. The secret string -- if provided -- will be included in the output of the cdk as part of synthesis, and will appear in the CloudFormation template in the console. This can be secure(-ish) if that value is merely reference to another resource (or one of its attributes), but if the value is a plaintext string, it will be visible to anyone with access to the CloudFormation template (via the AWS Console, SDKs, or CLI).

      Specifies text data that you want to encrypt and store in this new version of the secret. May be a simple string value, or a string representation of a JSON structure.

      Only one of secretStringBeta1, secretStringValue, and generateSecretString can be provided.

      Returns:
      this
    • secretStringValue

      @Stability(Stable) public SecretProps.Builder secretStringValue(SecretValue secretStringValue)
      Parameters:
      secretStringValue - Initial value for the secret. NOTE: *It is highly encouraged to leave this field undefined and allow SecretsManager to create the secret value. The secret string -- if provided -- will be included in the output of the cdk as part of synthesis, and will appear in the CloudFormation template in the console. This can be secure(-ish) if that value is merely reference to another resource (or one of its attributes), but if the value is a plaintext string, it will be visible to anyone with access to the CloudFormation template (via the AWS Console, SDKs, or CLI).

      Specifies text data that you want to encrypt and store in this new version of the secret. May be a simple string value. To provide a string representation of JSON structure, use SecretProps.secretObjectValue instead.

      Only one of secretStringBeta1, secretStringValue, 'secretObjectValue', and generateSecretString can be provided.

      Returns:
      this
    • build

      @Stability(Stable) public SecretProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<SecretProps>
      Returns:
      a new instance of SecretProps
      Throws:
      NullPointerException - if any required attribute was not provided