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
Maintainers
5
Created

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.72.0 (2020-11-06)

⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

  • rds: Serverless cluster enableHttpEndpoint renamed to enableDataApi
  • stepfunctions-tasks: type of outputLocation in the experimental Athena StartQueryExecution has been changed to s3.Location from string

Features

Bug Fixes

  • apigateway: changes to gateway response does not trigger auto deployment (#11068) (0c8264a), closes #10963
  • cfnspec: incorrect Route 53 health check configuration properties in CloudFormation specification (#11280) (f3c8b50), closes #issuecomment-717435271 #11096
  • cli: --no-previous-parameters incorrectly skips updates (#11288) (1bfc649)
  • core: many nested stacks make NodeJS run out of memory (#11250) (c124886)
  • core: multiple library copies lead to 'Assets must be defined within Stage or App' error (#11113) (fcfed39), closes #10314
  • core: support docker engine v20.10.0-beta1 (#11124) (87887a3)
  • dynamodb: Misconfigured metrics causing empty graphs (#11283) (9968669)
  • ecs: redirect config should honor openListener flag (#11115) (ed6e7ed)
  • event-targets: circular dependency when the lambda target is in a different stack (#11217) (e21f249), closes #10942
  • pipelines: asset stage can't support more than 50 assets (#11284) (5db8e80), closes #9353
  • secretsmanager: can't export secret name from Secret (#11202) (5dcdecb), closes #10914
  • secretsmanager: Secret.fromSecretName doesn't work with ECS (#11042) (fe1ce73), closes #10309 #10519
  • stepfunctions: stack overflow when referenced json path finding encounters a circular object graph (#11225) (f14d823), closes #9319
  • stepfunctions-tasks: Athena* APIs have incorrect supported integration patterns (#11188) (0f66833), closes #11045 #11246
  • stepfunctions-tasks: incorrect S3 permissions for AthenaStartQueryExecution (#11203) (b35c423)
  • explicitly set the 'ImagePullPrincipalType' of image (#11264) (29aa223), closes #10569

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 06 Nov 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