Introduction to AWS SSM Parameter Store

Welcome back! In our previous lessons, we explored the AWS Secrets Manager using the AWS SDK (Boto3) for Python. Today, we will delve into another vital component of AWS's secrets management ecosystem — the AWS Systems Manager Parameter Store, or SSM Parameter Store for short.

SSM Parameter Store is a service that provides secure, hierarchical storage for configuration data and secrets management. It helps you manage data like passwords, database strings, Amazon Machine Image (AMI) IDs, and license codes as parameter values. You can store values as text strings or encrypted data. By using Parameter Store, you can separate your secret and configuration data from your code. For more detailed information, refer to the official AWS Systems Manager Parameter Store documentation.

To communicate with the SSM Parameter Store, we will be using our trusty assistant, the AWS SDK for Python — Boto3, brushing up on what we have learned in previous lessons.

Types of Parameters

SSM Parameter Store supports three parameter types: String, SecureString, and StringList.

  • String: This type is used to represent plain text data. For example, it can store URLs, usernames, or any other configuration data represented as plain text.

  • SecureString: This type is used to represent sensitive data such as passwords, API keys, database connection strings, etc. SecureString parameters are encrypted with AWS Key Management Service for increased security.

  • StringList: This type is used to store a comma-separated list of values. For example, it can store a list of IP addresses or resource ARNs. Note that StringList cannot be encrypted.

Creating Parameters in AWS SSM Parameter Store

Let's start with something basic — creating parameters. Here's how to create plain text ("String") and encrypted ("SecureString") parameters using the Boto3 client:

Python
ssm = boto3.client('ssm')

# Create a plain text parameter for application's API URL
ssm.put_parameter(
    Name='/app_config/api_url',
    Value='https://api.myapp.com',
    Type='String',
)

# Create an encrypted parameter for application's API key
ssm.put_parameter(
    Name='/app_config/api_key',
    Value='my_encrypted_api_key',
    Type='SecureString',
)

Here, we initialize the Boto3 SSM client and use the put_parameter() function to create two parameters, one plain text and one encrypted.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal