Socket
Socket
Sign inDemoInstall

@aws-cdk/aws-ssm

Package Overview
Dependencies
18
Maintainers
5
Versions
288
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @aws-cdk/aws-ssm

The CDK Construct Library for AWS::SSM


Version published
Weekly downloads
123K
decreased by-0.64%
Maintainers
5
Created
Weekly downloads
 

Package description

What is @aws-cdk/aws-ssm?

@aws-cdk/aws-ssm is an AWS Cloud Development Kit (CDK) library that allows you to interact with AWS Systems Manager (SSM) services. It provides constructs for defining and managing SSM parameters, documents, and associations within your CDK applications.

What are @aws-cdk/aws-ssm's main functionalities?

Create SSM Parameter

This feature allows you to create a new SSM parameter. The code sample demonstrates how to create a string parameter named 'myParameter' with the value 'myValue'.

const ssm = require('@aws-cdk/aws-ssm');
const cdk = require('@aws-cdk/core');

const app = new cdk.App();
const stack = new cdk.Stack(app, 'MyStack');

new ssm.StringParameter(stack, 'MyParameter', {
  parameterName: 'myParameter',
  stringValue: 'myValue',
});

app.synth();

Retrieve SSM Parameter

This feature allows you to retrieve an existing SSM parameter. The code sample demonstrates how to retrieve a string parameter named 'myParameter' and log its value.

const ssm = require('@aws-cdk/aws-ssm');
const cdk = require('@aws-cdk/core');

const app = new cdk.App();
const stack = new cdk.Stack(app, 'MyStack');

const parameter = ssm.StringParameter.fromStringParameterName(stack, 'MyParameter', 'myParameter');

console.log(parameter.stringValue);

Create SSM Document

This feature allows you to create a new SSM document. The code sample demonstrates how to create a document with a shell script that echoes 'Hello World'.

const ssm = require('@aws-cdk/aws-ssm');
const cdk = require('@aws-cdk/core');

const app = new cdk.App();
const stack = new cdk.Stack(app, 'MyStack');

new ssm.CfnDocument(stack, 'MyDocument', {
  content: JSON.stringify({
    schemaVersion: '2.2',
    description: 'My SSM Document',
    mainSteps: [
      {
        action: 'aws:runShellScript',
        name: 'exampleStep',
        inputs: {
          runCommand: ['echo Hello World']
        }
      }
    ]
  }),
  documentType: 'Command'
});

app.synth();

Other packages similar to @aws-cdk/aws-ssm

Changelog

Source

1.67.0 (2020-10-07)

⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • monodk-experiment: This package is now deprected in favor of monocdk. Note that monocdk is still experimental.

Features

Bug Fixes

  • cli: 'stack already contains Metadata resource' warning (#10695) (e0b5508), closes #10625
  • cli: deploying a transformed template without changes fails (#10689) (d345919), closes #10650
  • cloudfront-origins: S3Origins with cross-stack buckets cause cyclic references (#10696) (0ec4588), closes #10399
  • codepipeline-actions: correctly name the triggering Event in CodeCommitSourceAction (#10706) (ff3a692), closes #10665
  • core: cannot override properties with . in the name (#10441) (063798b), closes #10109
  • core: Stacks from 3rd-party libraries do not synthesize correctly (#10690) (7bb5cf4), closes #10671
  • ec2: addExecuteFileCommand arguments cannot be omitted (#10692) (7178374), closes #10687
  • ec2: InitCommand.shellCommand() renders an argv command instead (#10691) (de9d2f7), closes #10684
  • ec2: memory optimised graviton2 instance type (#10615) (a72cfbd)
  • elbv2: metric(Un)HealthyHostCount don't use TargetGroup dimension (#10697) (9444399), closes #5046
  • glue: GetTableVersion permission not available for read (#10628) (b0c5699), closes #10577
  • glue: incorrect s3 prefix used for grant* in Table (#10627) (4d20079), closes #10582
  • pipelines: cannot use constructs in build environment (#10654) (bf2c629), closes #10535
  • pipelines: pipeline doesn't restart if CLI version changes (#10727) (0297f31), closes #10659
  • rds: secret for ServerlessCluster is not accessible programmatically (#10657) (028495e)
  • redshift: Allow redshift cluster securityGroupName to be generated (#10742) (effed09), closes #10740
  • stepfunctions: X-Ray policy does not match documentation (#10721) (8006459)

Readme

Source

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:

import * as ssm from '@aws-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:

using SSM parameter

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).

new ssm.StringParameter(stack, 'Parameter', {
  allowedPattern: '.*',
  description: 'The value Foo',
  parameterName: 'FooParameter',
  stringValue: 'Foo',
  tier: ssm.ParameterTier.ADVANCED,
});

creating SSM parameters

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.

Keywords

FAQs

Last updated on 07 Oct 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc