Class StringParameter
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.ssm.StringParameter
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IParameter
,IStringParameter
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:37.836Z")
@Stability(Stable)
public class StringParameter
extends Resource
implements IStringParameter, IParameter
Creates a new String SSM Parameter.
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());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ssm.IParameter
IParameter.Jsii$Default, IParameter.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ssm.IStringParameter
IStringParameter.Jsii$Default, IStringParameter.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
StringParameter
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
StringParameter
(software.amazon.jsii.JsiiObjectRef objRef) StringParameter
(software.constructs.Construct scope, String id, StringParameterProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IStringParameter
fromSecureStringParameterAttributes
(software.constructs.Construct scope, String id, SecureStringParameterAttributes attrs) Imports a secure string parameter from the SSM parameter store.static IStringParameter
fromStringParameterAttributes
(software.constructs.Construct scope, String id, StringParameterAttributes attrs) Imports an external string parameter with name and optional version.static IStringParameter
fromStringParameterName
(software.constructs.Construct scope, String id, String stringParameterName) Imports an external string parameter by name.The encryption key that is used to encrypt this parameter.The ARN of the SSM Parameter resource.The name of the SSM Parameter resource.The type of the SSM Parameter resource.The parameter value.grantRead
(IGrantable grantee) Grants read (DescribeParameter, GetParameter, GetParameterHistory) permissions on the SSM Parameter.grantWrite
(IGrantable grantee) Grants write (PutParameter) permissions on the SSM Parameter.static String
valueForSecureStringParameter
(software.constructs.Construct scope, String parameterName, Number version) Deprecated.static String
valueForStringParameter
(software.constructs.Construct scope, String parameterName) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.static String
valueForStringParameter
(software.constructs.Construct scope, String parameterName, Number version) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.static String
valueForTypedStringParameter
(software.constructs.Construct scope, String parameterName) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.static String
valueForTypedStringParameter
(software.constructs.Construct scope, String parameterName, ParameterType type) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.static String
valueForTypedStringParameter
(software.constructs.Construct scope, String parameterName, ParameterType type, Number version) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.static String
valueFromLookup
(Construct scope, String parameterName) Reads the value of an SSM parameter during synthesis through an environmental context provider.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
StringParameter
protected StringParameter(software.amazon.jsii.JsiiObjectRef objRef) -
StringParameter
protected StringParameter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
StringParameter
@Stability(Stable) public StringParameter(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull StringParameterProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
fromSecureStringParameterAttributes
@Stability(Stable) @NotNull public static IStringParameter fromSecureStringParameterAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull SecureStringParameterAttributes attrs) Imports a secure string parameter from the SSM parameter store.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
fromStringParameterAttributes
@Stability(Stable) @NotNull public static IStringParameter fromStringParameterAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull StringParameterAttributes attrs) Imports an external string parameter with name and optional version.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
fromStringParameterName
@Stability(Stable) @NotNull public static IStringParameter fromStringParameterName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String stringParameterName) Imports an external string parameter by name.- Parameters:
scope
- This parameter is required.id
- This parameter is required.stringParameterName
- This parameter is required.
-
valueForSecureStringParameter
@Stability(Deprecated) @Deprecated @NotNull public static String valueForSecureStringParameter(@NotNull software.constructs.Construct scope, @NotNull String parameterName, @NotNull Number version) Deprecated.UseSecretValue.ssmSecure()
instead, it will correctly type the imported value as aSecretValue
and allow importing without version.(deprecated) Returns a token that will resolve (during deployment).- Parameters:
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.
-
valueForStringParameter
@Stability(Stable) @NotNull public static String valueForStringParameter(@NotNull software.constructs.Construct scope, @NotNull String parameterName, @Nullable Number version) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.- Parameters:
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).
-
valueForStringParameter
@Stability(Stable) @NotNull public static String valueForStringParameter(@NotNull software.constructs.Construct scope, @NotNull String parameterName) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.- Parameters:
scope
- Some scope within a stack. This parameter is required.parameterName
- The name of the SSM parameter. This parameter is required.
-
valueForTypedStringParameter
@Stability(Stable) @NotNull public static String valueForTypedStringParameter(@NotNull software.constructs.Construct scope, @NotNull String parameterName, @Nullable ParameterType type, @Nullable Number version) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.- Parameters:
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).
-
valueForTypedStringParameter
@Stability(Stable) @NotNull public static String valueForTypedStringParameter(@NotNull software.constructs.Construct scope, @NotNull String parameterName, @Nullable ParameterType type) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.- Parameters:
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.
-
valueForTypedStringParameter
@Stability(Stable) @NotNull public static String valueForTypedStringParameter(@NotNull software.constructs.Construct scope, @NotNull String parameterName) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.- Parameters:
scope
- Some scope within a stack. This parameter is required.parameterName
- The name of the SSM parameter. This parameter is required.
-
valueFromLookup
@Stability(Stable) @NotNull public static String valueFromLookup(@NotNull Construct scope, @NotNull String parameterName) Reads the value of an SSM parameter during synthesis through an environmental context provider.Requires that the stack this scope is defined in will have explicit account/region information. Otherwise, it will fail during synthesis.
- Parameters:
scope
- This parameter is required.parameterName
- This parameter is required.
-
grantRead
Grants read (DescribeParameter, GetParameter, GetParameterHistory) permissions on the SSM Parameter.- Specified by:
grantRead
in interfaceIParameter
- Parameters:
grantee
- This parameter is required.
-
grantWrite
Grants write (PutParameter) permissions on the SSM Parameter.- Specified by:
grantWrite
in interfaceIParameter
- Parameters:
grantee
- This parameter is required.
-
getParameterArn
The ARN of the SSM Parameter resource.- Specified by:
getParameterArn
in interfaceIParameter
-
getParameterName
The name of the SSM Parameter resource.- Specified by:
getParameterName
in interfaceIParameter
-
getParameterType
The type of the SSM Parameter resource.- Specified by:
getParameterType
in interfaceIParameter
-
getStringValue
The parameter value.Value must not nest another parameter. Do not use {{}} in the value.
- Specified by:
getStringValue
in interfaceIStringParameter
-
getEncryptionKey
The encryption key that is used to encrypt this parameter.- @default - default master key
-
SecretValue.ssmSecure()
instead, it will correctly type the imported value as aSecretValue
and allow importing without version.