Show / Hide Table of Contents

Namespace Amazon.CDK.AWS.SSM

AWS Systems Manager Construct Library

--- cfn-resources: Stable cdk-constructs: Stable

This module is part of the AWS Cloud Development Kit project.

Installation

Install the module:

$ npm i @aws-cdk/aws-ssm

Import it into your code:

// Example automatically generated. See https://github.com/aws/jsii/issues/826
using Amazon.CDK.AWS.SSM;

Using existing SSM Parameters in your CDK app

You can reference existing SSM Parameter Store values that you want to use in your CDK app by using ssm.ParameterStoreString:

// Example automatically generated. See https://github.com/aws/jsii/issues/826
// Retrieve the latest value of the non-secret parameter
// with name "/My/String/Parameter".
string stringValue = StringParameter.FromStringParameterAttributes(this, "MyValue", new StringParameterAttributes {
    ParameterName = "/My/Public/Parameter"
}).StringValue;

// Retrieve a specific version of the secret (SecureString) parameter.
// 'version' is always required.
IStringParameter secretValue = StringParameter.FromSecureStringParameterAttributes(this, "MySecureValue", new SecureStringParameterAttributes {
    ParameterName = "/My/Secret/Parameter",
    Version = 5
});

Creating new SSM Parameters in your CDK app

You can create either ssm.StringParameter or ssm.StringListParameters in a CDK app. These are public (not secret) values. Parameters of type SecretString cannot be created directly from a CDK application; if you want to provision secrets automatically, use Secrets Manager Secrets (see the @aws-cdk/aws-secretsmanager package).

// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
new ssm.StringParameter(stack, "Parameter", new Struct {
    AllowedPattern = ".*",
    Description = "The value Foo",
    ParameterName = "FooParameter",
    StringValue = "Foo",
    Tier = ssm.ParameterTier.ADVANCED
});
// Example automatically generated. See https://github.com/aws/jsii/issues/826
// Create a new SSM Parameter holding a String
StringParameter param = new StringParameter(stack, "StringParameter", new StringParameterProps {
    // description: 'Some user-friendly description',
    // name: 'ParameterName',
    StringValue = "Initial parameter value"
});

// Grant read access to some Role
param.GrantRead(role);

// Create a new SSM Parameter holding a StringList
StringListParameter listParameter = new StringListParameter(stack, "StringListParameter", new StringListParameterProps {
    // description: 'Some user-friendly description',
    // name: 'ParameterName',
    StringListValue = new [] { "Initial parameter value A", "Initial parameter value B" }
});

When specifying an allowedPattern, the values provided as string literals are validated against the pattern and an exception is raised if a value provided does not comply.

Classes

CfnAssociation

A CloudFormation AWS::SSM::Association.

CfnAssociation.InstanceAssociationOutputLocationProperty
CfnAssociation.ParameterValuesProperty
CfnAssociation.S3OutputLocationProperty
CfnAssociation.TargetProperty
CfnAssociationProps

Properties for defining a AWS::SSM::Association.

CfnDocument

A CloudFormation AWS::SSM::Document.

CfnDocumentProps

Properties for defining a AWS::SSM::Document.

CfnMaintenanceWindow

A CloudFormation AWS::SSM::MaintenanceWindow.

CfnMaintenanceWindowProps

Properties for defining a AWS::SSM::MaintenanceWindow.

CfnMaintenanceWindowTarget

A CloudFormation AWS::SSM::MaintenanceWindowTarget.

CfnMaintenanceWindowTarget.TargetsProperty
CfnMaintenanceWindowTargetProps

Properties for defining a AWS::SSM::MaintenanceWindowTarget.

CfnMaintenanceWindowTask

A CloudFormation AWS::SSM::MaintenanceWindowTask.

CfnMaintenanceWindowTask.LoggingInfoProperty
CfnMaintenanceWindowTask.MaintenanceWindowAutomationParametersProperty
CfnMaintenanceWindowTask.MaintenanceWindowLambdaParametersProperty
CfnMaintenanceWindowTask.MaintenanceWindowRunCommandParametersProperty
CfnMaintenanceWindowTask.MaintenanceWindowStepFunctionsParametersProperty
CfnMaintenanceWindowTask.NotificationConfigProperty
CfnMaintenanceWindowTask.TargetProperty
CfnMaintenanceWindowTask.TaskInvocationParametersProperty
CfnMaintenanceWindowTaskProps

Properties for defining a AWS::SSM::MaintenanceWindowTask.

CfnParameter

A CloudFormation AWS::SSM::Parameter.

CfnParameterProps

Properties for defining a AWS::SSM::Parameter.

CfnPatchBaseline

A CloudFormation AWS::SSM::PatchBaseline.

CfnPatchBaseline.PatchFilterGroupProperty
CfnPatchBaseline.PatchFilterProperty
CfnPatchBaseline.PatchSourceProperty
CfnPatchBaseline.RuleGroupProperty
CfnPatchBaseline.RuleProperty
CfnPatchBaselineProps

Properties for defining a AWS::SSM::PatchBaseline.

CfnResourceDataSync

A CloudFormation AWS::SSM::ResourceDataSync.

CfnResourceDataSync.AwsOrganizationsSourceProperty
CfnResourceDataSync.S3DestinationProperty
CfnResourceDataSync.SyncSourceProperty
CfnResourceDataSyncProps

Properties for defining a AWS::SSM::ResourceDataSync.

CommonStringParameterAttributes

Common attributes for string parameters.

ParameterOptions

Properties needed to create a new SSM Parameter.

ParameterTier

SSM parameter tier.

ParameterType

SSM parameter type.

SecureStringParameterAttributes

Attributes for secure string parameters.

StringListParameter

Creates a new StringList SSM Parameter.

StringListParameterProps

Properties needed to create a StringList SSM Parameter.

StringParameter

Creates a new String SSM Parameter.

StringParameterAttributes

Attributes for parameters of various types of string.

StringParameterProps

Properties needed to create a String SSM parameter.

Interfaces

CfnAssociation.IInstanceAssociationOutputLocationProperty
CfnAssociation.IParameterValuesProperty
CfnAssociation.IS3OutputLocationProperty
CfnAssociation.ITargetProperty
CfnMaintenanceWindowTarget.ITargetsProperty
CfnMaintenanceWindowTask.ILoggingInfoProperty
CfnMaintenanceWindowTask.IMaintenanceWindowAutomationParametersProperty
CfnMaintenanceWindowTask.IMaintenanceWindowLambdaParametersProperty
CfnMaintenanceWindowTask.IMaintenanceWindowRunCommandParametersProperty
CfnMaintenanceWindowTask.IMaintenanceWindowStepFunctionsParametersProperty
CfnMaintenanceWindowTask.INotificationConfigProperty
CfnMaintenanceWindowTask.ITargetProperty
CfnMaintenanceWindowTask.ITaskInvocationParametersProperty
CfnPatchBaseline.IPatchFilterGroupProperty
CfnPatchBaseline.IPatchFilterProperty
CfnPatchBaseline.IPatchSourceProperty
CfnPatchBaseline.IRuleGroupProperty
CfnPatchBaseline.IRuleProperty
CfnResourceDataSync.IAwsOrganizationsSourceProperty
CfnResourceDataSync.IS3DestinationProperty
CfnResourceDataSync.ISyncSourceProperty
ICfnAssociationProps

Properties for defining a AWS::SSM::Association.

ICfnDocumentProps

Properties for defining a AWS::SSM::Document.

ICfnMaintenanceWindowProps

Properties for defining a AWS::SSM::MaintenanceWindow.

ICfnMaintenanceWindowTargetProps

Properties for defining a AWS::SSM::MaintenanceWindowTarget.

ICfnMaintenanceWindowTaskProps

Properties for defining a AWS::SSM::MaintenanceWindowTask.

ICfnParameterProps

Properties for defining a AWS::SSM::Parameter.

ICfnPatchBaselineProps

Properties for defining a AWS::SSM::PatchBaseline.

ICfnResourceDataSyncProps

Properties for defining a AWS::SSM::ResourceDataSync.

ICommonStringParameterAttributes

Common attributes for string parameters.

IParameter

An SSM Parameter reference.

IParameterOptions

Properties needed to create a new SSM Parameter.

ISecureStringParameterAttributes

Attributes for secure string parameters.

IStringListParameter

A StringList SSM Parameter.

IStringListParameterProps

Properties needed to create a StringList SSM Parameter.

IStringParameter

A String SSM Parameter.

IStringParameterAttributes

Attributes for parameters of various types of string.

IStringParameterProps

Properties needed to create a String SSM parameter.

Back to top Generated by DocFX