Class StringParameter
- All Implemented Interfaces:
IResource
,IParameter
,IStringParameter
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
Example:
StringParameter ssmParameter = StringParameter.Builder.create(this, "mySsmParameter") .parameterName("mySsmParameter") .stringValue("mySsmParameterValue") .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.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.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
fromStringParameterArn
(software.constructs.Construct scope, String id, String stringParameterArn) Imports an external string parameter by ARN.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, GetParameters, 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) Deprecated.use valueForTypedStringParameterV2 insteadstatic String
valueForTypedStringParameter
(software.constructs.Construct scope, String parameterName, ParameterType type) Deprecated.use valueForTypedStringParameterV2 insteadstatic String
valueForTypedStringParameter
(software.constructs.Construct scope, String parameterName, ParameterType type, Number version) Deprecated.use valueForTypedStringParameterV2 insteadstatic String
valueForTypedStringParameterV2
(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
valueForTypedStringParameterV2
(software.constructs.Construct scope, String parameterName, ParameterValueType type) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.static String
valueForTypedStringParameterV2
(software.constructs.Construct scope, String parameterName, ParameterValueType type, Number version) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.static String
valueFromLookup
(software.constructs.Construct scope, String parameterName) Reads the value of an SSM parameter during synthesis through an environmental context provider.static String
valueFromLookup
(software.constructs.Construct scope, String parameterName, String defaultValue) Reads the value of an SSM parameter during synthesis through an environmental context provider.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, 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.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.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.
-
fromStringParameterArn
@Stability(Stable) @NotNull public static IStringParameter fromStringParameterArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String stringParameterArn) Imports an external string parameter by ARN.- Parameters:
scope
- This parameter is required.id
- This parameter is required.stringParameterArn
- 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.SecretValue
lives in the coreaws-cdk-lib
module.(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(Deprecated) @Deprecated @NotNull public static String valueForTypedStringParameter(@NotNull software.constructs.Construct scope, @NotNull String parameterName, @Nullable ParameterType type, @Nullable Number version) Deprecated.- use valueForTypedStringParameterV2 instead
(deprecated) 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(Deprecated) @Deprecated @NotNull public static String valueForTypedStringParameter(@NotNull software.constructs.Construct scope, @NotNull String parameterName, @Nullable ParameterType type) Deprecated.- use valueForTypedStringParameterV2 instead
(deprecated) 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(Deprecated) @Deprecated @NotNull public static String valueForTypedStringParameter(@NotNull software.constructs.Construct scope, @NotNull String parameterName) Deprecated.- use valueForTypedStringParameterV2 instead
(deprecated) 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.
-
valueForTypedStringParameterV2
@Stability(Stable) @NotNull public static String valueForTypedStringParameterV2(@NotNull software.constructs.Construct scope, @NotNull String parameterName, @Nullable ParameterValueType 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).
-
valueForTypedStringParameterV2
@Stability(Stable) @NotNull public static String valueForTypedStringParameterV2(@NotNull software.constructs.Construct scope, @NotNull String parameterName, @Nullable ParameterValueType 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.
-
valueForTypedStringParameterV2
@Stability(Stable) @NotNull public static String valueForTypedStringParameterV2(@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 software.constructs.Construct scope, @NotNull String parameterName, @Nullable String defaultValue) 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.
If defaultValue is provided, it will be used as the dummyValue and the ContextProvider will be told NOT to raise an error on synthesis if the SSM Parameter is not found in the account at synth time.
- Parameters:
scope
- This parameter is required.parameterName
- This parameter is required.defaultValue
-
-
valueFromLookup
@Stability(Stable) @NotNull public static String valueFromLookup(@NotNull software.constructs.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.
If defaultValue is provided, it will be used as the dummyValue and the ContextProvider will be told NOT to raise an error on synthesis if the SSM Parameter is not found in the account at synth time.
- Parameters:
scope
- This parameter is required.parameterName
- This parameter is required.
-
grantRead
Grants read (DescribeParameter, GetParameters, 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.