@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:41.808Z") public class StringParameter extends Resource implements IStringParameter, IParameter
Example:
IVpc vpc = Vpc.fromVpcAttributes(this, "VPC", VpcAttributes.builder() .vpcId("vpc-1234") .availabilityZones(List.of("us-east-1a", "us-east-1b")) // Either pass literals for all IDs .publicSubnetIds(List.of("s-12345", "s-67890")) // OR: import a list of known length .privateSubnetIds(Fn.importListValue("PrivateSubnetIds", 2)) // OR: split an imported string to a list of known length .isolatedSubnetIds(Fn.split(",", StringParameter.valueForStringParameter(this, "MyParameter"), 2)) .build());
Modifier and Type | Class and Description |
---|---|
static class |
StringParameter.Builder
A fluent builder for
StringParameter . |
IStringParameter.Jsii$Default, IStringParameter.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
StringParameter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
StringParameter(software.amazon.jsii.JsiiObjectRef objRef) |
|
StringParameter(software.constructs.Construct scope,
java.lang.String id,
StringParameterProps props) |
Modifier and Type | Method and Description |
---|---|
static IStringParameter |
fromSecureStringParameterAttributes(software.constructs.Construct scope,
java.lang.String id,
SecureStringParameterAttributes attrs)
Imports a secure string parameter from the SSM parameter store.
|
static IStringParameter |
fromStringParameterAttributes(software.constructs.Construct scope,
java.lang.String id,
StringParameterAttributes attrs)
Imports an external string parameter with name and optional version.
|
static IStringParameter |
fromStringParameterName(software.constructs.Construct scope,
java.lang.String id,
java.lang.String stringParameterName)
Imports an external string parameter by name.
|
IKey |
getEncryptionKey()
The encryption key that is used to encrypt this parameter.
|
java.lang.String |
getParameterArn()
The ARN of the SSM Parameter resource.
|
java.lang.String |
getParameterName()
The name of the SSM Parameter resource.
|
java.lang.String |
getParameterType()
The type of the SSM Parameter resource.
|
java.lang.String |
getStringValue()
The parameter value.
|
Grant |
grantRead(IGrantable grantee)
Grants read (DescribeParameter, GetParameter, GetParameterHistory) permissions on the SSM Parameter.
|
Grant |
grantWrite(IGrantable grantee)
Grants write (PutParameter) permissions on the SSM Parameter.
|
static java.lang.String |
valueForSecureStringParameter(software.constructs.Construct scope,
java.lang.String parameterName,
java.lang.Number version)
Deprecated.
Use `SecretValue.ssmSecure()` instead, it will correctly type the imported value as a `SecretValue` and allow importing without version.
|
static java.lang.String |
valueForStringParameter(software.constructs.Construct scope,
java.lang.String parameterName)
Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.
|
static java.lang.String |
valueForStringParameter(software.constructs.Construct scope,
java.lang.String parameterName,
java.lang.Number version)
Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.
|
static java.lang.String |
valueForTypedStringParameter(software.constructs.Construct scope,
java.lang.String parameterName)
Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.
|
static java.lang.String |
valueForTypedStringParameter(software.constructs.Construct scope,
java.lang.String parameterName,
ParameterType type)
Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.
|
static java.lang.String |
valueForTypedStringParameter(software.constructs.Construct scope,
java.lang.String parameterName,
ParameterType type,
java.lang.Number version)
Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.
|
static java.lang.String |
valueFromLookup(Construct scope,
java.lang.String parameterName)
Reads the value of an SSM parameter during synthesis through an environmental context provider.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected StringParameter(software.amazon.jsii.JsiiObjectRef objRef)
protected StringParameter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public StringParameter(software.constructs.Construct scope, java.lang.String id, StringParameterProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public static IStringParameter fromSecureStringParameterAttributes(software.constructs.Construct scope, java.lang.String id, SecureStringParameterAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public static IStringParameter fromStringParameterAttributes(software.constructs.Construct scope, java.lang.String id, StringParameterAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public static IStringParameter fromStringParameterName(software.constructs.Construct scope, java.lang.String id, java.lang.String stringParameterName)
scope
- This parameter is required.id
- This parameter is required.stringParameterName
- This parameter is required.@Deprecated public static java.lang.String valueForSecureStringParameter(software.constructs.Construct scope, java.lang.String parameterName, java.lang.Number version)
scope
- Some scope within a stack. This parameter is required.parameterName
- The name of the SSM parameter. This parameter is required.version
- The parameter version (required for secure strings). This parameter is required.public static java.lang.String valueForStringParameter(software.constructs.Construct scope, java.lang.String parameterName, java.lang.Number version)
scope
- Some scope within a stack. This parameter is required.parameterName
- The name of the SSM parameter. This parameter is required.version
- The parameter version (recommended in order to ensure that the value won't change during deployment).public static java.lang.String valueForStringParameter(software.constructs.Construct scope, java.lang.String parameterName)
scope
- Some scope within a stack. This parameter is required.parameterName
- The name of the SSM parameter. This parameter is required.public static java.lang.String valueForTypedStringParameter(software.constructs.Construct scope, java.lang.String parameterName, ParameterType type, java.lang.Number version)
scope
- Some scope within a stack. This parameter is required.parameterName
- The name of the SSM parameter. This parameter is required.type
- The type of the SSM parameter.version
- The parameter version (recommended in order to ensure that the value won't change during deployment).public static java.lang.String valueForTypedStringParameter(software.constructs.Construct scope, java.lang.String parameterName, ParameterType type)
scope
- Some scope within a stack. This parameter is required.parameterName
- The name of the SSM parameter. This parameter is required.type
- The type of the SSM parameter.public static java.lang.String valueForTypedStringParameter(software.constructs.Construct scope, java.lang.String parameterName)
scope
- Some scope within a stack. This parameter is required.parameterName
- The name of the SSM parameter. This parameter is required.public static java.lang.String valueFromLookup(Construct scope, java.lang.String parameterName)
Requires that the stack this scope is defined in will have explicit account/region information. Otherwise, it will fail during synthesis.
scope
- This parameter is required.parameterName
- This parameter is required.public Grant grantRead(IGrantable grantee)
grantRead
in interface IParameter
grantee
- This parameter is required.public Grant grantWrite(IGrantable grantee)
grantWrite
in interface IParameter
grantee
- This parameter is required.public java.lang.String getParameterArn()
getParameterArn
in interface IParameter
public java.lang.String getParameterName()
getParameterName
in interface IParameter
public java.lang.String getParameterType()
getParameterType
in interface IParameter
public java.lang.String getStringValue()
Value must not nest another parameter. Do not use {{}} in the value.
getStringValue
in interface IStringParameter
public IKey getEncryptionKey()