Interface SecretAttributes

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
SecretAttributes.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:41.305Z") @Stability(Stable) public interface SecretAttributes extends software.amazon.jsii.JsiiSerializable
Attributes required to import an existing secret into the Stack.

One ARN format (secretArn, secretCompleteArn, secretPartialArn) must be provided.

Example:

 Key encryptionKey;
 ISecret secret = Secret.fromSecretAttributes(this, "ImportedSecret", SecretAttributes.builder()
         .secretArn("arn:aws:secretsmanager:<region>:<account-id-number>:secret:<secret-name>-<random-6-characters>")
         // If the secret is encrypted using a KMS-hosted CMK, either import or reference that key:
         .encryptionKey(encryptionKey)
         .build());
 
  • Method Details

    • getEncryptionKey

      @Stability(Stable) @Nullable default IKey getEncryptionKey()
      The encryption key that is used to encrypt the secret, unless the default SecretsManager key is used.
    • getSecretArn

      @Stability(Deprecated) @Deprecated @Nullable default String getSecretArn()
      Deprecated.
      use secretCompleteArn or secretPartialArn instead.
      (deprecated) The ARN of the secret in SecretsManager.

      Cannot be used with secretCompleteArn or secretPartialArn.

    • getSecretCompleteArn

      @Stability(Stable) @Nullable default String getSecretCompleteArn()
      The complete ARN of the secret in SecretsManager.

      This is the ARN including the Secrets Manager 6-character suffix. Cannot be used with secretArn or secretPartialArn.

    • getSecretPartialArn

      @Stability(Stable) @Nullable default String getSecretPartialArn()
      The partial ARN of the secret in SecretsManager.

      This is the ARN without the Secrets Manager 6-character suffix. Cannot be used with secretArn or secretCompleteArn.

    • builder

      @Stability(Stable) static SecretAttributes.Builder builder()
      Returns:
      a SecretAttributes.Builder of SecretAttributes