@Generated(value="jsii-pacmak/1.30.0 (build adae23f)", date="2021-06-30T10:00:44.847Z") @Stability(value=Experimental) public class SecretValue extends Intrinsic
Secret values in the CDK (such as those retrieved from SecretsManager) are represented as regular strings, just like other values that are only available at deployment time.
To help you avoid accidental mistakes which would lead to you putting your
secret values directly into a CloudFormation template, constructs that take
secret values will not allow you to pass in a literal secret value. They do
so by calling Secret.assertSafeSecret().
You can escape the check by calling Secret.plainText(), but doing
so is highly discouraged.
| Modifier and Type | Class and Description |
|---|---|
static class |
SecretValue.Builder
(experimental) A fluent builder for
SecretValue. |
software.amazon.jsii.JsiiObject.InitializationModeIResolvable.Jsii$Default, IResolvable.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
protected |
SecretValue(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
SecretValue(software.amazon.jsii.JsiiObjectRef objRef) |
|
SecretValue(Object value) |
|
SecretValue(Object value,
IntrinsicProps options) |
| Modifier and Type | Method and Description |
|---|---|
static SecretValue |
cfnDynamicReference(CfnDynamicReference ref)
(experimental) Obtain the secret value through a CloudFormation dynamic reference.
|
static SecretValue |
cfnParameter(CfnParameter param)
(experimental) Obtain the secret value through a CloudFormation parameter.
|
static SecretValue |
plainText(String secret)
(experimental) Construct a literal secret value for use with secret-aware constructs.
|
static SecretValue |
secretsManager(String secretId)
(experimental) Creates a `SecretValue` with a value which is dynamically loaded from AWS Secrets Manager.
|
static SecretValue |
secretsManager(String secretId,
SecretsManagerSecretOptions options)
(experimental) Creates a `SecretValue` with a value which is dynamically loaded from AWS Secrets Manager.
|
static SecretValue |
ssmSecure(String parameterName,
String version)
(experimental) Use a secret value stored from a Systems Manager (SSM) parameter.
|
getCreationStack, newError, resolve, toJSON, toStringjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected SecretValue(software.amazon.jsii.JsiiObjectRef objRef)
protected SecretValue(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public SecretValue(@NotNull
Object value,
@Nullable
IntrinsicProps options)
value - This parameter is required.options - @Stability(value=Experimental)
public SecretValue(@NotNull
Object value)
value - This parameter is required.@Stability(value=Experimental) @NotNull public static SecretValue cfnDynamicReference(@NotNull CfnDynamicReference ref)
If possible, use SecretValue.ssmSecure or SecretValue.secretsManager directly.
ref - The dynamic reference to use. This parameter is required.@Stability(value=Experimental) @NotNull public static SecretValue cfnParameter(@NotNull CfnParameter param)
Generally, this is not a recommended approach. AWS Secrets Manager is the recommended way to reference secrets.
param - The CloudFormation parameter to use. This parameter is required.@Stability(value=Experimental) @NotNull public static SecretValue plainText(@NotNull String secret)
Do not use this method for any secrets that you care about.
The only reasonable use case for using this method is when you are testing.
secret - This parameter is required.@Stability(value=Experimental) @NotNull public static SecretValue secretsManager(@NotNull String secretId, @Nullable SecretsManagerSecretOptions options)
secretId - The ID or ARN of the secret. This parameter is required.options - Options.@Stability(value=Experimental) @NotNull public static SecretValue secretsManager(@NotNull String secretId)
secretId - The ID or ARN of the secret. This parameter is required.@Stability(value=Experimental) @NotNull public static SecretValue ssmSecure(@NotNull String parameterName, @NotNull String version)
parameterName - The name of the parameter in the Systems Manager Parameter Store. This parameter is required.version - An integer that specifies the version of the parameter to use. This parameter is required.Copyright © 2021. All rights reserved.