Package software.amazon.awscdk.services.ssm
AWS Systems Manager Construct Library
---
AWS CDK v1 has reached End-of-Support on 2023-06-01. This package is no longer being updated, and users should migrate to AWS CDK v2.
For more information on how to migrate, see the Migrating to AWS CDK v2 guide.
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:
import software.amazon.awscdk.services.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.StringParameter.fromStringParameterAttributes
:
// Retrieve the latest value of the non-secret parameter // with name "/My/String/Parameter". String stringValue = StringParameter.fromStringParameterAttributes(this, "MyValue", StringParameterAttributes.builder() .parameterName("/My/Public/Parameter") .build()).getStringValue(); String stringValueVersionFromToken = StringParameter.fromStringParameterAttributes(this, "MyValueVersionFromToken", StringParameterAttributes.builder() .parameterName("/My/Public/Parameter") // parameter version from token .version(parameterVersion) .build()).getStringValue(); // Retrieve a specific version of the secret (SecureString) parameter. // 'version' is always required. IStringParameter secretValue = StringParameter.fromSecureStringParameterAttributes(this, "MySecureValue", SecureStringParameterAttributes.builder() .parameterName("/My/Secret/Parameter") .version(5) .build()); IStringParameter secretValueVersionFromToken = StringParameter.fromSecureStringParameterAttributes(this, "MySecureValueVersionFromToken", SecureStringParameterAttributes.builder() .parameterName("/My/Secret/Parameter") // parameter version from token .version(parameterVersion) .build());
Creating new SSM Parameters in your CDK app
You can create either ssm.StringParameter
or ssm.StringListParameter
s in
a CDK app. These are public (not secret) values. Parameters of type
SecureString 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).
StringParameter.Builder.create(this, "Parameter") .allowedPattern(".*") .description("The value Foo") .parameterName("FooParameter") .stringValue("Foo") .tier(ParameterTier.ADVANCED) .build();
// Create a new SSM Parameter holding a String StringParameter param = StringParameter.Builder.create(stack, "StringParameter") // description: 'Some user-friendly description', // name: 'ParameterName', .stringValue("Initial parameter value") .build(); // Grant read access to some Role param.grantRead(role); // Create a new SSM Parameter holding a StringList StringListParameter listParameter = StringListParameter.Builder.create(stack, "StringListParameter") // description: 'Some user-friendly description', // name: 'ParameterName', .stringListValue(List.of("Initial parameter value A", "Initial parameter value B")) .build();
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.
Deprecated: AWS CDK v1 has reached End-of-Support on 2023-06-01.
This package is no longer being updated, and users should migrate to AWS CDK v2.
For more information on how to migrate, see https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html
-
ClassDescriptionA CloudFormation
AWS::SSM::Association
.A fluent builder forCfnAssociation
.InstanceAssociationOutputLocation
is a property of the AWS::SSM::Association resource that specifies an Amazon S3 bucket where you want to store the results of this association request.A builder forCfnAssociation.InstanceAssociationOutputLocationProperty
An implementation forCfnAssociation.InstanceAssociationOutputLocationProperty
S3OutputLocation
is a property of the AWS::SSM::Association resource that specifies an Amazon S3 bucket where you want to store the results of this association request.A builder forCfnAssociation.S3OutputLocationProperty
An implementation forCfnAssociation.S3OutputLocationProperty
Target
is a property of the AWS::SSM::Association resource that specifies the targets for an SSM document in Systems Manager .A builder forCfnAssociation.TargetProperty
An implementation forCfnAssociation.TargetProperty
Properties for defining aCfnAssociation
.A builder forCfnAssociationProps
An implementation forCfnAssociationProps
A CloudFormationAWS::SSM::Document
.Identifying information about a document attachment, including the file name and a key-value pair that identifies the location of an attachment to a document.A builder forCfnDocument.AttachmentsSourceProperty
An implementation forCfnDocument.AttachmentsSourceProperty
A fluent builder forCfnDocument
.An SSM document required by the current document.A builder forCfnDocument.DocumentRequiresProperty
An implementation forCfnDocument.DocumentRequiresProperty
Properties for defining aCfnDocument
.A builder forCfnDocumentProps
An implementation forCfnDocumentProps
A CloudFormationAWS::SSM::MaintenanceWindow
.A fluent builder forCfnMaintenanceWindow
.Properties for defining aCfnMaintenanceWindow
.A builder forCfnMaintenanceWindowProps
An implementation forCfnMaintenanceWindowProps
A CloudFormationAWS::SSM::MaintenanceWindowTarget
.A fluent builder forCfnMaintenanceWindowTarget
.TheTargets
property type specifies adding a target to a maintenance window target in AWS Systems Manager .A builder forCfnMaintenanceWindowTarget.TargetsProperty
An implementation forCfnMaintenanceWindowTarget.TargetsProperty
Properties for defining aCfnMaintenanceWindowTarget
.A builder forCfnMaintenanceWindowTargetProps
An implementation forCfnMaintenanceWindowTargetProps
A CloudFormationAWS::SSM::MaintenanceWindowTask
.A fluent builder forCfnMaintenanceWindowTask
.Configuration options for sending command output to Amazon CloudWatch Logs.A builder forCfnMaintenanceWindowTask.CloudWatchOutputConfigProperty
An implementation forCfnMaintenanceWindowTask.CloudWatchOutputConfigProperty
TheLoggingInfo
property type specifies information about the Amazon S3 bucket to write instance-level logs to.A builder forCfnMaintenanceWindowTask.LoggingInfoProperty
An implementation forCfnMaintenanceWindowTask.LoggingInfoProperty
TheMaintenanceWindowAutomationParameters
property type specifies the parameters for anAUTOMATION
task type for a maintenance window task in AWS Systems Manager .An implementation forCfnMaintenanceWindowTask.MaintenanceWindowAutomationParametersProperty
TheMaintenanceWindowLambdaParameters
property type specifies the parameters for aLAMBDA
task type for a maintenance window task in AWS Systems Manager .An implementation forCfnMaintenanceWindowTask.MaintenanceWindowLambdaParametersProperty
TheMaintenanceWindowRunCommandParameters
property type specifies the parameters for aRUN_COMMAND
task type for a maintenance window task in AWS Systems Manager .An implementation forCfnMaintenanceWindowTask.MaintenanceWindowRunCommandParametersProperty
TheMaintenanceWindowStepFunctionsParameters
property type specifies the parameters for the execution of aSTEP_FUNCTIONS
task in a Systems Manager maintenance window.An implementation forCfnMaintenanceWindowTask.MaintenanceWindowStepFunctionsParametersProperty
TheNotificationConfig
property type specifies configurations for sending notifications for a maintenance window task in AWS Systems Manager .A builder forCfnMaintenanceWindowTask.NotificationConfigProperty
An implementation forCfnMaintenanceWindowTask.NotificationConfigProperty
TheTarget
property type specifies targets (either instances or window target IDs).A builder forCfnMaintenanceWindowTask.TargetProperty
An implementation forCfnMaintenanceWindowTask.TargetProperty
TheTaskInvocationParameters
property type specifies the task execution parameters for a maintenance window task in AWS Systems Manager .An implementation forCfnMaintenanceWindowTask.TaskInvocationParametersProperty
Properties for defining aCfnMaintenanceWindowTask
.A builder forCfnMaintenanceWindowTaskProps
An implementation forCfnMaintenanceWindowTaskProps
A CloudFormationAWS::SSM::Parameter
.A fluent builder forCfnParameter
.Properties for defining aCfnParameter
.A builder forCfnParameterProps
An implementation forCfnParameterProps
A CloudFormationAWS::SSM::PatchBaseline
.A fluent builder forCfnPatchBaseline
.ThePatchFilterGroup
property type specifies a set of patch filters for an AWS Systems Manager patch baseline, typically used for approval rules for a Systems Manager patch baseline.A builder forCfnPatchBaseline.PatchFilterGroupProperty
An implementation forCfnPatchBaseline.PatchFilterGroupProperty
ThePatchFilter
property type defines a patch filter for an AWS Systems Manager patch baseline.A builder forCfnPatchBaseline.PatchFilterProperty
An implementation forCfnPatchBaseline.PatchFilterProperty
A builder forCfnPatchBaseline.PatchSourceProperty
An implementation forCfnPatchBaseline.PatchSourceProperty
TheRuleGroup
property type specifies a set of rules that define the approval rules for an AWS Systems Manager patch baseline.A builder forCfnPatchBaseline.RuleGroupProperty
An implementation forCfnPatchBaseline.RuleGroupProperty
TheRule
property type specifies an approval rule for a Systems Manager patch baseline.A builder forCfnPatchBaseline.RuleProperty
An implementation forCfnPatchBaseline.RuleProperty
Properties for defining aCfnPatchBaseline
.A builder forCfnPatchBaselineProps
An implementation forCfnPatchBaselineProps
A CloudFormationAWS::SSM::ResourceDataSync
.Information about theAwsOrganizationsSource
resource data sync source.A builder forCfnResourceDataSync.AwsOrganizationsSourceProperty
An implementation forCfnResourceDataSync.AwsOrganizationsSourceProperty
A fluent builder forCfnResourceDataSync
.Information about the target S3 bucket for the resource data sync.A builder forCfnResourceDataSync.S3DestinationProperty
An implementation forCfnResourceDataSync.S3DestinationProperty
Information about the source of the data included in the resource data sync.A builder forCfnResourceDataSync.SyncSourceProperty
An implementation forCfnResourceDataSync.SyncSourceProperty
Properties for defining aCfnResourceDataSync
.A builder forCfnResourceDataSyncProps
An implementation forCfnResourceDataSyncProps
A CloudFormationAWS::SSM::ResourcePolicy
.A fluent builder forCfnResourcePolicy
.Properties for defining aCfnResourcePolicy
.A builder forCfnResourcePolicyProps
An implementation forCfnResourcePolicyProps
Common attributes for string parameters.A builder forCommonStringParameterAttributes
An implementation forCommonStringParameterAttributes
An SSM Parameter reference.Internal default implementation forIParameter
.A proxy class which represents a concrete javascript instance of this type.A StringList SSM Parameter.Internal default implementation forIStringListParameter
.A proxy class which represents a concrete javascript instance of this type.A String SSM Parameter.Internal default implementation forIStringParameter
.A proxy class which represents a concrete javascript instance of this type.SSM parameter data type.Properties needed to create a new SSM Parameter.A builder forParameterOptions
An implementation forParameterOptions
SSM parameter tier.SSM parameter type.Attributes for secure string parameters.A builder forSecureStringParameterAttributes
An implementation forSecureStringParameterAttributes
Creates a new StringList SSM Parameter.A fluent builder forStringListParameter
.Properties needed to create a StringList SSM Parameter.A builder forStringListParameterProps
An implementation forStringListParameterProps
Creates a new String SSM Parameter.A fluent builder forStringParameter
.Attributes for parameters of various types of string.A builder forStringParameterAttributes
An implementation forStringParameterAttributes
Properties needed to create a String SSM parameter.A builder forStringParameterProps
An implementation forStringParameterProps