@Generated(value="jsii-pacmak/0.21.1 (build 9ff44cb)", date="2020-01-16T18:33:57.269Z") @Stability(value=Stable) 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.
software.amazon.jsii.JsiiObject.InitializationModeIResolvable.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
protected |
SecretValue(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
SecretValue(software.amazon.jsii.JsiiObjectRef objRef) |
|
SecretValue(Object value)
EXPERIMENTAL
|
| Modifier and Type | Method and Description |
|---|---|
static SecretValue |
cfnDynamicReference(CfnDynamicReference ref)
Obtain the secret value through a CloudFormation dynamic reference.
|
static SecretValue |
cfnParameter(CfnParameter param)
Obtain the secret value through a CloudFormation parameter.
|
static SecretValue |
plainText(String secret)
Construct a literal secret value for use with secret-aware constructs.
|
static SecretValue |
secretsManager(String secretId)
Creates a `SecretValue` with a value which is dynamically loaded from AWS Secrets Manager.
|
static SecretValue |
secretsManager(String secretId,
SecretsManagerSecretOptions options)
Creates a `SecretValue` with a value which is dynamically loaded from AWS Secrets Manager.
|
static SecretValue |
ssmSecure(String parameterName,
String version)
Use a secret value stored from a Systems Manager (SSM) parameter.
|
getCreationStack, newError, resolve, toJSON, toStringjsiiAsyncCall, jsiiCall, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticGet, jsiiStaticSetprotected SecretValue(software.amazon.jsii.JsiiObjectRef objRef)
protected SecretValue(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental) public SecretValue(Object value)
value - This parameter is required.@Stability(value=Stable) public static SecretValue cfnDynamicReference(CfnDynamicReference ref)
If possible, use SecretValue.ssmSecure or SecretValue.secretsManager directly.
ref - The dynamic reference to use. This parameter is required.@Stability(value=Stable) public static SecretValue cfnParameter(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=Stable) public static SecretValue plainText(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=Stable) public static SecretValue secretsManager(String secretId, SecretsManagerSecretOptions options)
secretId - The ID or ARN of the secret. This parameter is required.options - Options.@Stability(value=Stable) public static SecretValue secretsManager(String secretId)
secretId - The ID or ARN of the secret. This parameter is required.@Stability(value=Stable) public static SecretValue ssmSecure(String parameterName, 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 © 2020. All rights reserved.