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.StringListParameters 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.InstanceAssociationOutputLocationis 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.InstanceAssociationOutputLocationPropertyAn implementation forCfnAssociation.InstanceAssociationOutputLocationPropertyS3OutputLocationis 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.S3OutputLocationPropertyAn implementation forCfnAssociation.S3OutputLocationPropertyTargetis a property of the AWS::SSM::Association resource that specifies the targets for an SSM document in Systems Manager .A builder forCfnAssociation.TargetPropertyAn implementation forCfnAssociation.TargetPropertyProperties for defining aCfnAssociation.A builder forCfnAssociationPropsAn implementation forCfnAssociationPropsA 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.AttachmentsSourcePropertyAn implementation forCfnDocument.AttachmentsSourcePropertyA fluent builder forCfnDocument.An SSM document required by the current document.A builder forCfnDocument.DocumentRequiresPropertyAn implementation forCfnDocument.DocumentRequiresPropertyProperties for defining aCfnDocument.A builder forCfnDocumentPropsAn implementation forCfnDocumentPropsA CloudFormationAWS::SSM::MaintenanceWindow.A fluent builder forCfnMaintenanceWindow.Properties for defining aCfnMaintenanceWindow.A builder forCfnMaintenanceWindowPropsAn implementation forCfnMaintenanceWindowPropsA CloudFormationAWS::SSM::MaintenanceWindowTarget.A fluent builder forCfnMaintenanceWindowTarget.TheTargetsproperty type specifies adding a target to a maintenance window target in AWS Systems Manager .A builder forCfnMaintenanceWindowTarget.TargetsPropertyAn implementation forCfnMaintenanceWindowTarget.TargetsPropertyProperties for defining aCfnMaintenanceWindowTarget.A builder forCfnMaintenanceWindowTargetPropsAn implementation forCfnMaintenanceWindowTargetPropsA CloudFormationAWS::SSM::MaintenanceWindowTask.A fluent builder forCfnMaintenanceWindowTask.Configuration options for sending command output to Amazon CloudWatch Logs.A builder forCfnMaintenanceWindowTask.CloudWatchOutputConfigPropertyAn implementation forCfnMaintenanceWindowTask.CloudWatchOutputConfigPropertyTheLoggingInfoproperty type specifies information about the Amazon S3 bucket to write instance-level logs to.A builder forCfnMaintenanceWindowTask.LoggingInfoPropertyAn implementation forCfnMaintenanceWindowTask.LoggingInfoPropertyTheMaintenanceWindowAutomationParametersproperty type specifies the parameters for anAUTOMATIONtask type for a maintenance window task in AWS Systems Manager .An implementation forCfnMaintenanceWindowTask.MaintenanceWindowAutomationParametersPropertyTheMaintenanceWindowLambdaParametersproperty type specifies the parameters for aLAMBDAtask type for a maintenance window task in AWS Systems Manager .An implementation forCfnMaintenanceWindowTask.MaintenanceWindowLambdaParametersPropertyTheMaintenanceWindowRunCommandParametersproperty type specifies the parameters for aRUN_COMMANDtask type for a maintenance window task in AWS Systems Manager .An implementation forCfnMaintenanceWindowTask.MaintenanceWindowRunCommandParametersPropertyTheMaintenanceWindowStepFunctionsParametersproperty type specifies the parameters for the execution of aSTEP_FUNCTIONStask in a Systems Manager maintenance window.An implementation forCfnMaintenanceWindowTask.MaintenanceWindowStepFunctionsParametersPropertyTheNotificationConfigproperty type specifies configurations for sending notifications for a maintenance window task in AWS Systems Manager .A builder forCfnMaintenanceWindowTask.NotificationConfigPropertyAn implementation forCfnMaintenanceWindowTask.NotificationConfigPropertyTheTargetproperty type specifies targets (either instances or window target IDs).A builder forCfnMaintenanceWindowTask.TargetPropertyAn implementation forCfnMaintenanceWindowTask.TargetPropertyTheTaskInvocationParametersproperty type specifies the task execution parameters for a maintenance window task in AWS Systems Manager .An implementation forCfnMaintenanceWindowTask.TaskInvocationParametersPropertyProperties for defining aCfnMaintenanceWindowTask.A builder forCfnMaintenanceWindowTaskPropsAn implementation forCfnMaintenanceWindowTaskPropsA CloudFormationAWS::SSM::Parameter.A fluent builder forCfnParameter.Properties for defining aCfnParameter.A builder forCfnParameterPropsAn implementation forCfnParameterPropsA CloudFormationAWS::SSM::PatchBaseline.A fluent builder forCfnPatchBaseline.ThePatchFilterGroupproperty 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.PatchFilterGroupPropertyAn implementation forCfnPatchBaseline.PatchFilterGroupPropertyThePatchFilterproperty type defines a patch filter for an AWS Systems Manager patch baseline.A builder forCfnPatchBaseline.PatchFilterPropertyAn implementation forCfnPatchBaseline.PatchFilterPropertyA builder forCfnPatchBaseline.PatchSourcePropertyAn implementation forCfnPatchBaseline.PatchSourcePropertyTheRuleGroupproperty type specifies a set of rules that define the approval rules for an AWS Systems Manager patch baseline.A builder forCfnPatchBaseline.RuleGroupPropertyAn implementation forCfnPatchBaseline.RuleGroupPropertyTheRuleproperty type specifies an approval rule for a Systems Manager patch baseline.A builder forCfnPatchBaseline.RulePropertyAn implementation forCfnPatchBaseline.RulePropertyProperties for defining aCfnPatchBaseline.A builder forCfnPatchBaselinePropsAn implementation forCfnPatchBaselinePropsA CloudFormationAWS::SSM::ResourceDataSync.Information about theAwsOrganizationsSourceresource data sync source.A builder forCfnResourceDataSync.AwsOrganizationsSourcePropertyAn implementation forCfnResourceDataSync.AwsOrganizationsSourcePropertyA fluent builder forCfnResourceDataSync.Information about the target S3 bucket for the resource data sync.A builder forCfnResourceDataSync.S3DestinationPropertyAn implementation forCfnResourceDataSync.S3DestinationPropertyInformation about the source of the data included in the resource data sync.A builder forCfnResourceDataSync.SyncSourcePropertyAn implementation forCfnResourceDataSync.SyncSourcePropertyProperties for defining aCfnResourceDataSync.A builder forCfnResourceDataSyncPropsAn implementation forCfnResourceDataSyncPropsA CloudFormationAWS::SSM::ResourcePolicy.A fluent builder forCfnResourcePolicy.Properties for defining aCfnResourcePolicy.A builder forCfnResourcePolicyPropsAn implementation forCfnResourcePolicyPropsCommon attributes for string parameters.A builder forCommonStringParameterAttributesAn implementation forCommonStringParameterAttributesAn 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 forParameterOptionsAn implementation forParameterOptionsSSM parameter tier.SSM parameter type.Attributes for secure string parameters.A builder forSecureStringParameterAttributesAn implementation forSecureStringParameterAttributesCreates a new StringList SSM Parameter.A fluent builder forStringListParameter.Properties needed to create a StringList SSM Parameter.A builder forStringListParameterPropsAn implementation forStringListParameterPropsCreates a new String SSM Parameter.A fluent builder forStringParameter.Attributes for parameters of various types of string.A builder forStringParameterAttributesAn implementation forStringParameterAttributesProperties needed to create a String SSM parameter.A builder forStringParameterPropsAn implementation forStringParameterProps