Class StringParameter
Creates a new String SSM Parameter.
public class StringParameter : Resource, IStringParameter, IParameter, IResource, IConstruct, IConstruct, IDependable
- Inheritance
-
StringParameter
- Implements
-
IResourceIConstructIConstructIDependable
Examples
var vpc = Vpc.FromVpcAttributes(this, "VPC", new VpcAttributes {
VpcId = "vpc-1234",
AvailabilityZones = new [] { "us-east-1a", "us-east-1b" },
// Either pass literals for all IDs
PublicSubnetIds = new [] { "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)
});
Remarks
Resource: AWS::SSM::Parameter
ExampleMetadata: infused
Constructors
StringParameter(Construct, string, IStringParameterProps)
public StringParameter(Construct scope, string id, IStringParameterProps props)
Parameters
scope
Constructid
stringprops
IStringParameterProps
Properties
EncryptionKey
The encryption key that is used to encrypt this parameter.
public virtual IKey? EncryptionKey { get; }
Property Value
- IKey
Remarks
ParameterArn
The ARN of the SSM Parameter resource.
public virtual string ParameterArn { get; }
Property Value
ParameterName
The name of the SSM Parameter resource.
public virtual string ParameterName { get; }
Property Value
ParameterType
The type of the SSM Parameter resource.
public virtual string ParameterType { get; }
Property Value
StringValue
The parameter value.
public virtual string StringValue { get; }
Property Value
Remarks
Value must not nest another parameter. Do not use {{}} in the value.
Methods
FromSecureStringParameterAttributes(Construct, string, ISecureStringParameterAttributes)
Imports a secure string parameter from the SSM parameter store.
public static IStringParameter FromSecureStringParameterAttributes(Construct scope, string id, ISecureStringParameterAttributes attrs)
Parameters
scope
Constructid
stringattrs
ISecureStringParameterAttributes
Returns
FromStringParameterAttributes(Construct, string, IStringParameterAttributes)
Imports an external string parameter with name and optional version.
public static IStringParameter FromStringParameterAttributes(Construct scope, string id, IStringParameterAttributes attrs)
Parameters
scope
Constructid
stringattrs
IStringParameterAttributes
Returns
FromStringParameterName(Construct, string, string)
Imports an external string parameter by name.
public static IStringParameter FromStringParameterName(Construct scope, string id, string stringParameterName)
Parameters
Returns
GrantRead(IGrantable)
Grants read (DescribeParameter, GetParameter, GetParameterHistory) permissions on the SSM Parameter.
public virtual Grant GrantRead(IGrantable grantee)
Parameters
grantee
IGrantable
Returns
- Grant
GrantWrite(IGrantable)
Grants write (PutParameter) permissions on the SSM Parameter.
public virtual Grant GrantWrite(IGrantable grantee)
Parameters
grantee
IGrantable
Returns
- Grant
ValueForSecureStringParameter(Construct, string, double)
(deprecated) Returns a token that will resolve (during deployment).
[Obsolete("Use `SecretValue.ssmSecure()` instead, it will correctly type the imported value as a `SecretValue` and allow importing without version.")]
public static string ValueForSecureStringParameter(Construct scope, string parameterName, double version)
Parameters
scope
ConstructSome scope within a stack.
parameterName
stringThe name of the SSM parameter.
version
doubleThe parameter version (required for secure strings).
Returns
Remarks
Stability: Deprecated
ValueForStringParameter(Construct, string, double?)
Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.
public static string ValueForStringParameter(Construct scope, string parameterName, double? version = null)
Parameters
scope
ConstructSome scope within a stack.
parameterName
stringThe name of the SSM parameter.
version
double?The parameter version (recommended in order to ensure that the value won't change during deployment).
Returns
ValueForTypedStringParameter(Construct, string, ParameterType?, double?)
Returns a token that will resolve (during deployment) to the string value of an SSM string parameter.
public static string ValueForTypedStringParameter(Construct scope, string parameterName, ParameterType? type = null, double? version = null)
Parameters
scope
ConstructSome scope within a stack.
parameterName
stringThe name of the SSM parameter.
type
ParameterType?The type of the SSM parameter.
version
double?The parameter version (recommended in order to ensure that the value won't change during deployment).
Returns
ValueFromLookup(Construct, string)
Reads the value of an SSM parameter during synthesis through an environmental context provider.
public static string ValueFromLookup(Construct scope, string parameterName)
Parameters
scope
ConstructparameterName
string
Returns
Remarks
Requires that the stack this scope is defined in will have explicit account/region information. Otherwise, it will fail during synthesis.