- Implements: aws-cdk-lib.aws_ssm.IStringParameter, aws-cdk-lib.aws_ssm.IParameter
import { StringParameter } from '@pepperize/cdk-ssm-parameters-cross-region'
new StringParameter(scope: Construct, id: string, props: StringParameterProps)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
props |
StringParameterProps |
No description. |
- Type: constructs.Construct
- Type: string
- Type: StringParameterProps
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
grantRead |
Grants read (DescribeParameter, GetParameter, GetParameterHistory) permissions on the SSM Parameter. |
grantWrite |
Grants write (PutParameter) permissions on the SSM Parameter. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
public grantRead(grantee: IGrantable): Grant
Grants read (DescribeParameter, GetParameter, GetParameterHistory) permissions on the SSM Parameter.
- Type: aws-cdk-lib.aws_iam.IGrantable
public grantWrite(grantee: IGrantable): Grant
Grants write (PutParameter) permissions on the SSM Parameter.
- Type: aws-cdk-lib.aws_iam.IGrantable
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isResource |
Check whether the given construct is a Resource. |
fromStringParameterAttributes |
Imports an external string parameter with name and optional version. |
fromStringParameterName |
Imports an external string parameter by name and region. |
valueFromLookup |
Reads the value of an SSM parameter during synthesis through an environmental context provider. |
import { StringParameter } from '@pepperize/cdk-ssm-parameters-cross-region'
StringParameter.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
import { StringParameter } from '@pepperize/cdk-ssm-parameters-cross-region'
StringParameter.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
import { StringParameter } from '@pepperize/cdk-ssm-parameters-cross-region'
StringParameter.fromStringParameterAttributes(scope: Construct, id: string, attrs: StringParameterAttributes)
Imports an external string parameter with name and optional version.
- Type: constructs.Construct
- Type: string
import { StringParameter } from '@pepperize/cdk-ssm-parameters-cross-region'
StringParameter.fromStringParameterName(scope: Construct, id: string, region: string, parameterName: string)
Imports an external string parameter by name and region.
- Type: constructs.Construct
- Type: string
- Type: string
- Type: string
import { StringParameter } from '@pepperize/cdk-ssm-parameters-cross-region'
StringParameter.valueFromLookup(scope: Construct, region: string, parameterName: string)
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 information. Otherwise, it will fail during synthesis.
- Type: constructs.Construct
- Type: string
- Type: string
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
parameterArn |
string |
The ARN of the SSM Parameter resource. |
parameterName |
string |
The name of the SSM Parameter resource. |
parameterType |
string |
The type of the SSM Parameter resource. |
stringValue |
string |
The parameter value. |
tags |
aws-cdk-lib.TagManager |
No description. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly parameterArn: string;
- Type: string
The ARN of the SSM Parameter resource.
public readonly parameterName: string;
- Type: string
The name of the SSM Parameter resource.
public readonly parameterType: string;
- Type: string
The type of the SSM Parameter resource.
public readonly stringValue: string;
- Type: string
The parameter value.
Value must not nest another parameter. Do not use {{}} in the value.
public readonly tags: TagManager;
- Type: aws-cdk-lib.TagManager
import { StringParameterAttributes } from '@pepperize/cdk-ssm-parameters-cross-region'
const stringParameterAttributes: StringParameterAttributes = { ... }
Name | Type | Description |
---|---|---|
parameterName |
string |
The name of the parameter store value. |
simpleName |
boolean |
Indicates of the parameter name is a simple name (i.e. does not include "/" separators). |
type |
aws-cdk-lib.aws_ssm.ParameterType |
The type of the string parameter. |
version |
number |
The version number of the value you wish to retrieve. |
region |
string |
The region to retrieve the parameter from. |
public readonly parameterName: string;
- Type: string
The name of the parameter store value.
This value can be a token or a concrete string. If it is a concrete string and includes "/" it must also be prefixed with a "/" (fully-qualified).
public readonly simpleName: boolean;
- Type: boolean
- Default: auto-detect based on
parameterName
Indicates of the parameter name is a simple name (i.e. does not include "/" separators).
This is only required only if parameterName
is a token, which means we
are unable to detect if the name is simple or "path-like" for the purpose
of rendering SSM parameter ARNs.
If parameterName
is not specified, simpleName
must be true
(or
undefined) since the name generated by AWS CloudFormation is always a
simple name.
public readonly type: ParameterType;
- Type: aws-cdk-lib.aws_ssm.ParameterType
- Default: ParameterType.STRING
The type of the string parameter.
public readonly version: number;
- Type: number
- Default: The latest version will be retrieved.
The version number of the value you wish to retrieve.
public readonly region: string;
- Type: string
The region to retrieve the parameter from.
See AWS.SSM.region for more information.
Properties needed to create a String SSM parameter.
import { StringParameterProps } from '@pepperize/cdk-ssm-parameters-cross-region'
const stringParameterProps: StringParameterProps = { ... }
Name | Type | Description |
---|---|---|
parameterName |
string |
The name of the parameter. |
region |
string |
The region to create the parameter in. |
stringValue |
string |
The value of the parameter. |
allowedPattern |
string |
A regular expression used to validate the parameter value. |
dataType |
aws-cdk-lib.aws_ssm.ParameterDataType |
The data type of the parameter, such as text or aws:ec2:image . |
description |
string |
Information about the parameter that you want to add to the system. |
removalPolicy |
aws-cdk-lib.RemovalPolicy |
Whether to retain or delete the parameter on CloudFormation delete event. |
tier |
aws-cdk-lib.aws_ssm.ParameterTier |
The tier of the string parameter. |
public readonly parameterName: string;
- Type: string
- Default: a name will be generated by CloudFormation
The name of the parameter.
It may not be a
public readonly region: string;
- Type: string
The region to create the parameter in.
See AWS.SSM.region for more information.
public readonly stringValue: string;
- Type: string
The value of the parameter.
It may not reference another parameter and {{}}
cannot be used in the value.
public readonly allowedPattern: string;
- Type: string
- Default: undefined, no validation is performed
A regular expression used to validate the parameter value.
public readonly dataType: ParameterDataType;
- Type: aws-cdk-lib.aws_ssm.ParameterDataType
- Default: undefined
The data type of the parameter, such as text
or aws:ec2:image
.
public readonly description: string;
- Type: string
- Default: undefined
Information about the parameter that you want to add to the system.
public readonly removalPolicy: RemovalPolicy;
- Type: aws-cdk-lib.RemovalPolicy
- Default: DESTROY
Whether to retain or delete the parameter on CloudFormation delete event.
public readonly tier: ParameterTier;
- Type: aws-cdk-lib.aws_ssm.ParameterTier
- Default: undefined
The tier of the string parameter.