

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Identity and Access Management (IAM)
incomplete
2: IAM Users
incomplete
3: Inline Policies
incomplete
4: IAM Groups
incomplete
5: IAM Roles
incomplete
6: Deny Policies
incomplete
7: SSM Parameters
incomplete
8: SSM Parameters Are Strings
incomplete
9: Accessing SSM Parameters from EC2
incomplete
10: Use SSM from EC2
incomplete
11: Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
One important thing to understand about the SSM Parameter Store is that everything is stored as a string.
When you save api.example.com for the host name, SSM stores it as a string. When you set true as a dev tools flag, SSM stores it as the string "true", not a boolean. In this sense, SSM parameters are a lot like environment variables.
5) → stored as string "5" → your app must parse ittrue) → stored as string "true" → your app must compare it3.14) → stored as string "3.14" → your app must parse itred) → stored as string "red" → your app must compare it{"key": "value"}) → stored as string "{\"key\": \"value\"}" → your app must parse itCost check: Standard SSM parameters are free (up to 10,000). This lesson is conceptual; no new parameters required.
When you retrieve a parameter from SSM, you get a string. Your application must then cast the value to the type you need. For example, if you're using Python:
import boto3
# get the parameter from SSM and store the string in secret_str
secret_str = ssm_get_parameter("/SECRETS")
# if the value is supposed to represent an integer, convert it
raw_port_number = ssm_get_parameter("/PORT_NUMBER")
try:
port = int(raw_port_number)
print(f"port number is {port}")
except ValueError:
raise ValueError("raw_port_number turned out not to be a number")