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
resource "aws_ssm_parameter" "global_google_geocoding_api_key" {
name = "/Environment/global/GOOGLE_GEOCODING_API_KEY"
type = "SecureString"
value = "redacted"
}
resource "aws_ssm_parameter" "global_google_geocoding_api_key" {
name = "/Environment/global/GOOGLE_GEOCODING_API_KEY"
type = "SecureString"
value = "redacted"
}
resource "aws_ssm_parameter" "api_port" {
name = "API_PORT"
type = "SecureString"
value = var.api_port
}
Parameters
-
allowed_pattern
optional - string -
arn
optional computed - string -
data_type
optional computed - string -
description
optional - string -
id
optional computed - string -
key_id
optional computed - string -
name
required - string -
overwrite
optional - bool -
tags
optional - map from string to string -
tier
optional - string -
type
required - string -
value
required - string -
version
optional computed - number
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 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
Type: AWS::SSM::Parameter::Value<String>
Default: BookmarksChatBotSnsTopicArn
BookmarksToolsLayerArn:
Type: AWS::SSM::Parameter::Value<String>
Default: BookmarksToolsLayerArn
Type: "AWS::SSM::Parameter"
Properties:
Name: "Cluster"
Type: "String"
Value: "app-cluster"
DevLoadBalancerArn:
Type: "AWS::SSM::Parameter"
Properties:
Name: /${self:service}/IdentityPoolId/${self:provider.stage}
Type: String
Value: ${cf:garmin-log-client-svc-${self:provider.stage}.IdentityPoolId}
Type : "AWS::SSM::Parameter"
Properties:
Name: "/${self:provider.stage}/formsli/app/name"
Description : Application Name
Value: formsli
Type: String
Type: AWS::SSM::Parameter
Properties:
Name: discourse-common-Customer
Type: String
Description: Name of customer or company
Value: !Ref pDiscourseCommonCustomer
"Type": "AWS::SSM::Parameter",
"Properties": {
"Name": "/dev/formsli/app/name",
"Description": "Application Name",
"Value": "formsli",
"Type": "String"
"Type": "AWS::SSM::Parameter",
"Properties": {
"Name": "/dev/formsli/app/name",
"Description": "Application Name",
"Value": "formsli",
"Type": "String"
"Type": "AWS::SSM::Parameter",
"Properties": {
"Name": {
"Fn::Join": ["", ["/cmbp/", { "Ref": "Environment" }, "/server/port"]]
},
"Type": "String",
"Type": "AWS::SSM::Parameter",
"Properties": {
"Type": "String",
"Value": "hello, world"
}
},
"Type": "AWS::SSM::Parameter",
"Properties": {
"Type": "String",
"Value": "hello, world"
}
},
Parameters
-
Type
required - String -
Description
optional - String -
Policies
optional - String -
AllowedPattern
optional - String -
Tier
optional - String -
Value
required - String -
DataType
optional - String -
Tags
optional - Json -
Name
optional - String
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
andssm:AddTagsToResource
. On stack creation, AWS CloudFormation adds the following three tags to the parameter:aws:cloudformation:stack-name
,aws:cloudformation:logical-id
, andaws: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 bothssm:AddTagsToResource
andssm: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.
For CloudFormation, the sinofseven/sar-billing-report-to-slack, aws-samples/aws-vending-pipelines-workshop and zerotreedelta/garmin-log-client-svc source code examples are useful. See the CloudFormation Example section for further details.