1. Answers
  2. Creating an AWS SSM Parameter

How do I create an AWS SSM parameter?

To create an AWS SSM (Systems Manager) parameter using Pulumi, you will use the aws.ssm.Parameter resource. This resource allows you to store configuration data and secrets in a centralized location, which can be accessed by your applications and services.

Below is a Pulumi program written in TypeScript that demonstrates how to create an AWS SSM parameter.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// Create an SSM parameter
const ssmParameter = new aws.ssm.Parameter("myParameter", {
    name: "/my/parameter",
    type: "String",
    value: "myParameterValue",
    description: "This is a sample SSM parameter",
    tags: {
        Environment: "Dev",
    },
});

// Export the name of the parameter
export const parameterName = ssmParameter.name;

In this program, we perform the following steps:

  1. Import the necessary Pulumi and AWS libraries.
  2. Create an SSM parameter using the aws.ssm.Parameter resource.
    • name: The name of the parameter.
    • type: The type of the parameter (e.g., String, StringList, SecureString).
    • value: The value of the parameter.
    • description: A description of the parameter.
    • tags: Tags to categorize the parameter.
  3. Export the name of the created parameter.

This program will create an SSM parameter named /my/parameter with the value myParameterValue. The parameter is tagged with Environment: Dev and includes a description. The name of the parameter is exported as a stack output.

Deploy this code

Want to deploy this code? Sign up for a free Pulumi account to deploy in a few clicks.

Sign up

New to Pulumi?

Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.

Sign up