AWS Systems Manager Parameter

This page shows how to write Terraform and CloudFormation for Systems Manager Parameter and write them securely.

aws_ssm_parameter (Terraform)

The Parameter in Systems Manager can be configured in Terraform with the resource name aws_ssm_parameter. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

github-iconVJ-CCS-Tech-ops/cmpdevforcode
resource "aws_ssm_parameter" "global_google_geocoding_api_key" {
    name = "/Environment/global/GOOGLE_GEOCODING_API_KEY"
    type = "SecureString"
    value = "redacted"
}

github-iconCrown-Commercial-Service/CMpDevEnvironment
resource "aws_ssm_parameter" "global_google_geocoding_api_key" {
    name = "/Environment/global/GOOGLE_GEOCODING_API_KEY"
    type = "SecureString"
    value = "redacted"
}

github-icontetsuzawa/recipesapi
resource "aws_ssm_parameter" "api_port" {
  name  = "API_PORT"
  type  = "SecureString"
  value = var.api_port
}

Parameters

Explanation in Terraform Registry

Provides an SSM Parameter resource.

AWS::SSM::Parameter (CloudFormation)

The Parameter in SSM can be configured in CloudFormation with the resource name AWS::SSM::Parameter. The following sections describe how to use the resource and its parameters.

Parameters

Explanation in CloudFormation Registry

The AWS::SSM::Parameter resource creates an SSM parameter in AWS Systems Manager Parameter Store.

Important To create an SSM parameter, you must have the AWS Identity and Access Management (IAM) permissions ssm:PutParameter and ssm:AddTagsToResource. On stack creation, AWS CloudFormation adds the following three tags to the parameter: aws:cloudformation:stack-name, aws:cloudformation:logical-id, and aws:cloudformation:stack-id, in addition to any custom tags you specify. To add, update, or remove tags during stack update, you must have IAM permissions for both ssm:AddTagsToResource and ssm:RemoveTagsFromResource. For more information, see Managing Access Using Policies in the AWS Systems Manager User Guide.

For information about valid values for parameters, see Requirements and Constraints for Parameter Names in the AWS Systems Manager User Guide and PutParameter in the AWS Systems Manager API Reference.

Frequently asked questions

What is AWS Systems Manager Parameter?

AWS Systems Manager Parameter is a resource for Systems Manager of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Systems Manager Parameter?

For Terraform, the VJ-CCS-Tech-ops/cmpdevforcode, Crown-Commercial-Service/CMpDevEnvironment and tetsuzawa/recipesapi source code examples are useful. See the Terraform Example section for further details.