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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ssm.IParameter
IParameter.Jsii$Default, IParameter.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ssm.IStringParameter
IStringParameter.Jsii$Default, IStringParameter.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStringParameter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedStringParameter(software.amazon.jsii.JsiiObjectRef objRef) StringParameter(software.constructs.Construct scope, String id, StringParameterProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IStringParameterfromSecureStringParameterAttributes(software.constructs.Construct scope, String id, SecureStringParameterAttributes attrs) Imports a secure string parameter from the SSM parameter store.static IStringParameterfromStringParameterArn(software.constructs.Construct scope, String id, String stringParameterArn) Imports an external string parameter by ARN.static IStringParameterfromStringParameterAttributes(software.constructs.Construct scope, String id, StringParameterAttributes attrs) Imports an external string parameter with name and optional version.static IStringParameterfromStringParameterName(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 StringvalueForSecureStringParameter(software.constructs.Construct scope, String parameterName, Number version) Deprecated.static StringvalueForStringParameter(software.constructs.Construct scope, String parameterName) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.static StringvalueForStringParameter(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 StringvalueForTypedStringParameter(software.constructs.Construct scope, String parameterName) Deprecated.use valueForTypedStringParameterV2 insteadstatic StringvalueForTypedStringParameter(software.constructs.Construct scope, String parameterName, ParameterType type) Deprecated.use valueForTypedStringParameterV2 insteadstatic StringvalueForTypedStringParameter(software.constructs.Construct scope, String parameterName, ParameterType type, Number version) Deprecated.use valueForTypedStringParameterV2 insteadstatic StringvalueForTypedStringParameterV2(software.constructs.Construct scope, String parameterName) Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.static StringvalueForTypedStringParameterV2(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 StringvalueForTypedStringParameterV2(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 StringvalueFromLookup(software.constructs.Construct scope, String parameterName) Reads the value of an SSM parameter during synthesis through an environmental context provider.static StringvalueFromLookup(software.constructs.Construct scope, String parameterName, String defaultValue) Reads the value of an SSM parameter during synthesis through an environmental context provider.static StringvalueFromLookup(software.constructs.Construct scope, String parameterName, String defaultValue, StringParameterLookupOptions options) 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, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
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 aSecretValueand allow importing without version.SecretValuelives in the coreaws-cdk-libmodule.(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, @Nullable StringParameterLookupOptions options) 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-options-
-
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:
grantReadin interfaceIParameter- Parameters:
grantee- This parameter is required.
-
grantWrite
Grants write (PutParameter) permissions on the SSM Parameter.- Specified by:
grantWritein interfaceIParameter- Parameters:
grantee- This parameter is required.
-
getParameterArn
The ARN of the SSM Parameter resource.- Specified by:
getParameterArnin interfaceIParameter
-
getParameterName
The name of the SSM Parameter resource.- Specified by:
getParameterNamein interfaceIParameter
-
getParameterType
The type of the SSM Parameter resource.- Specified by:
getParameterTypein interfaceIParameter
-
getStringValue
The parameter value.Value must not nest another parameter. Do not use {{}} in the value.
- Specified by:
getStringValuein 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 aSecretValueand allow importing without version.