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.
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
StringListcannot be encrypted.
Let's start with something basic — creating parameters. Here's how to create plain text ("String") and encrypted ("SecureString") parameters using the Boto3 client:
Here, we initialize the Boto3 SSM client and use the put_parameter() function to create two parameters, one plain text and one encrypted.
