How to Read and Write AWS Systems Manager Parameter Store with AWS Emulator
With AWS Emulator running locally, you can save and read values in SSM (AWS Systems Manager) Parameter Store with the AWS CLI, without an AWS account. This is for testing, locally or in CI, the code that reads app settings such as database hosts, passwords, and feature flags from Parameter Store. This article covers saving strings and passwords (SecureString), reading them in bulk by path, and using previous versions and labels. All commands and their output are copied from the test environment as-is.
The test environment was Ubuntu 24.04 (x86_64), AWS Emulator 1.0.486 (released November 17, 2026), and AWS CLI 2.40.4. I did not use an AWS account or credentials. I did not verify how the real Parameter Store behaves for pricing, the per-second request limits, IAM permission evaluation, actual KMS encryption, or advanced parameters. Statements about real AWS are based on the official documentation. The 12-digit account ID in the output has been replaced.
- 1. Start the emulator and point the AWS CLI at it
- 2. Save values with three types
- 3. Read one value
- 4. Read SecureString with –with-decryption
- 5. Overwriting requires –overwrite
- 6. Read several at once
- 7. Read previous versions and point to them with labels
- 8. Deleting parameters, and what happens when the emulator stops
Start the emulator and point the AWS CLI at it
AWS Emulator is an emulator that accepts AWS API calls on your machine. According to the official documentation, no AWS account is needed, and requests are not sent to AWS.
For installation, see the separate article "How to Get Started with AWS Emulator on Ubuntu." Here I installed the Debian package from the Linux instructions, after verifying its gpg signature following the official verification steps. I worked as root, so I did not use sudo, but the commands below include it for a regular user.
curl -fsSLO https://downloads.aws.com/aws-emulator/packages/aws-emulator/LTS/latest/aws-emulator_amd64.deb
sudo apt-get install -y ./aws-emulator_amd64.deb
Start the emulator with aws-emulator. The -t off option turns off the telemetry (usage data sent to AWS by default). The emulator keeps running on that terminal, so use the AWS CLI from another terminal.
aws-emulator -t off
In another terminal, set the environment variables from the official documentation. The emulator listens on 127.0.0.1:9297 and writes an access key valid only for this run, a config file for the AWS CLI, and a certificate to ~/.aws/emulator/9297/.
export AWS_ENDPOINT_URL=https://127.0.0.1:9297
export AWS_SHARED_CREDENTIALS_FILE=~/.aws/emulator/9297/emulator_credentials
export AWS_CONFIG_FILE=~/.aws/emulator/9297/config
export AWS_CA_BUNDLE=~/.aws/emulator/9297/ca.pem
export AWS_EC2_METADATA_DISABLED=true
export AWS_DISABLE_HOST_PREFIX_INJECTION=true
export AWS_REGION=us-east-1
export AWS_DEFAULT_REGION=us-east-1
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_PROFILE
The official documentation warns that if AWS_ENDPOINT_URL is not set in the shell, commands will use any credentials they find and be sent to the real AWS. On a machine that has real credentials, run commands only in a shell where all the environment variables above are set.
As described in the official verification steps, if the ARN ends with user/emulator, the emulator is answering. Right after startup, there are no parameters.
$ aws sts get-caller-identity --query Arn --output text
arn:aws:iam::<12桁のアカウントID>:user/emulator
$ aws ssm describe-parameters
{
"Parameters": []
}
Save values with three types
You save a value with put-parameter. According to the PutParameter API reference, the type (--type) is one of String, StringList, or SecureString. StringList is a comma-separated list of values, and the reference says to use String if a value itself must contain commas. SecureString is a type that stores the value encrypted with a KMS key.
Names can be organized into hierarchies using /. Here I grouped the app settings under /example/app.
$ aws ssm put-parameter --name /example/app/db/host --value db.example.com --type String
{
"Version": 1,
"Tier": "Standard"
}
$ aws ssm put-parameter --name /example/app/db/password --value "p@ssw0rd-example" --type SecureString
{
"Version": 1,
"Tier": "Standard"
}
$ aws ssm put-parameter --name /example/app/features --value "search,export" --type StringList
{
"Version": 1,
"Tier": "Standard"
}
$ aws ssm put-parameter --name /example/app/log-level --value info --type String --description "ログの出力レベル"
{
"Version": 1,
"Tier": "Standard"
}
All of them returned Version 1, and Tier (a category with different pricing and limits) was Standard when I did not specify it. According to the reference, on real AWS a Standard value can be up to 4 KB with no additional charge.
Read one value
You read with get-parameter. If you specify nothing else, it returns the type, version, and ARN in JSON.
$ aws ssm get-parameter --name /example/app/db/host
{
"Parameter": {
"Name": "/example/app/db/host",
"Type": "String",
"Value": "db.example.com",
"Version": 1,
"LastModifiedDate": "2026-11-17T07:30:32.786957+00:00",
"ARN": "arn:aws:ssm:us-east-1:<12桁のアカウントID>:parameter/example/app/db/host",
"DataType": "text"
}
}
If you want only the value, add --query Parameter.Value --output text. To store it in a variable in a shell script, use this form.
$ aws ssm get-parameter --name /example/app/db/host --query Parameter.Value --output text
db.example.com
$ DB_HOST=$(aws ssm get-parameter --name /example/app/db/host --query Parameter.Value --output text); echo "接続先: $DB_HOST"
接続先: db.example.com
For StringList too, the returned value was a single string joined by commas. If you want an array, split it on the reading side.
$ aws ssm get-parameter --name /example/app/features --query "Parameter.[Type, Value]" --output text
StringList search,export
Read SecureString with –with-decryption
If you read a SecureString as is, you get the encrypted string back. The original value was returned only when I added --with-decryption.
$ aws ssm get-parameter --name /example/app/db/password --query "Parameter.[Type, Value]"
[
"SecureString",
"ASQ4MGFlM2Q5Zi1hY2IyLTQzMmEtOGU0Mi1iMGIxMzc1Mjg2YWSMw7zLnv78C3ugrQoh8TyRtBFq5R/DWfG9WIsfrGEFCj/xAWf0vgvOvwqn+A=="
]
$ aws ssm get-parameter --name /example/app/db/password --with-decryption --query Parameter.Value --output text
p@ssw0rd-example
According to the GetParameter reference, --with-decryption is ignored for String and StringList. So you can keep it on when reading a mix of types together.
You can check which key encrypted a value with KeyId from describe-parameters. A SecureString saved without --key-id showed alias/aws/ssm. This is the alias of the AWS managed key used when no key is specified, as described in the Parameter Store encryption documentation.
$ aws ssm describe-parameters --query "Parameters[].[Name, Type, KeyId]" --output text
/example/app/db/host String None
/example/app/db/password SecureString alias/aws/ssm
/example/app/features StringList None
/example/app/log-level String None
Overwriting requires –overwrite
If you run put-parameter again with the same name, you get a ParameterAlreadyExists error. To change the value, add --overwrite. After overwriting, Version became 2.
$ aws ssm put-parameter --name /example/app/db/host --value db2.example.com --type String
aws: [ERROR]: An error occurred (ParameterAlreadyExists) when calling the PutParameter operation: The parameter already exists. To overwrite this value, set the overwrite option in the request to true.
$ aws ssm put-parameter --name /example/app/db/host --value db2.example.com --overwrite
{
"Version": 2,
"Tier": "Standard"
}
$ aws ssm get-parameter --name /example/app/db/host --query "Parameter.[Value, Version]" --output text
db2.example.com 2
When overwriting, I could omit --type, but omitting it when creating a new parameter caused a ValidationException. The reference also says the type is required when creating and not needed when updating.
$ aws ssm put-parameter --name /example/app/timeout --value 30
aws: [ERROR]: An error occurred (ValidationException) when calling the PutParameter operation: Type is required when creating a parameter
Reading a name that does not exist with get-parameter gives ParameterNotFound, and the exit code was 254. However, according to the AWS CLI return codes documentation, 254 is the general code for when the service returns an error. The ParameterAlreadyExists and ValidationException above also returned 254. To tell that a value is missing, check the error type ParameterNotFound, not the exit code.
$ aws ssm get-parameter --name /example/app/nothing
aws: [ERROR]: An error occurred (ParameterNotFound) when calling the GetParameter operation:
Read several at once
To read a list of names together, use get-parameters. Missing names did not cause an error. Found parameters were returned in Parameters, and names not found were returned in InvalidParameters.
$ aws ssm get-parameters --names /example/app/db/host /example/app/log-level /example/app/nothing --query "{found: Parameters[].Name, invalid: InvalidParameters}"
{
"found": [
"/example/app/db/host",
"/example/app/log-level"
],
"invalid": [
"/example/app/nothing"
]
}
To read everything under a hierarchy, use get-parameters-by-path. With only --path /example/app, it returned just features and log-level directly under it, and the two under db were not included. Adding --recursive returns everything at all levels below.
$ aws ssm get-parameters-by-path --path /example/app --query "Parameters[].Name"
[
"/example/app/features",
"/example/app/log-level"
]
$ aws ssm get-parameters-by-path --path /example/app --recursive --query "Parameters[].Name"
[
"/example/app/db/host",
"/example/app/db/password",
"/example/app/features",
"/example/app/log-level"
]

To read all settings at app startup, add both --recursive and --with-decryption. The SecureString was also returned as its original value.
$ aws ssm get-parameters-by-path --path /example/app --recursive --with-decryption --query "Parameters[].[Name, Value]" --output text
/example/app/db/host db2.example.com
/example/app/db/password p@ssw0rd-example
/example/app/features search,export
/example/app/log-level info
According to the GetParametersByPath reference, on real AWS a single call returns a limited number of items, and you pass NextToken to read the rest. According to the AWS CLI pagination documentation, the CLI by default also fetches the following pages and combines them into one output.
Read previous versions and point to them with labels
Overwriting does not delete the previous value. You can see the value for each version with get-parameter-history.
$ aws ssm get-parameter-history --name /example/app/db/host --query "Parameters[].{Version: Version, Value: Value, Labels: Labels}"
[
{
"Version": 1,
"Value": "db.example.com",
"Labels": []
},
{
"Version": 2,
"Value": "db2.example.com",
"Labels": []
}
]
To read a specific version, append :version-number to the name. The returned Selector contained the :1 I specified.
$ aws ssm get-parameter --name /example/app/db/host:1 --query "Parameter.[Value, Version, Selector]" --output text
db.example.com 1 :1
Instead of a number, you can point to a version with a label, a name attached to the version. I attached stable to version 1 with label-parameter-version.
$ aws ssm label-parameter-version --name /example/app/db/host --parameter-version 1 --labels stable
{
"InvalidLabels": [],
"ParameterVersion": 1
}
$ aws ssm get-parameter --name /example/app/db/host:stable --query "Parameter.[Value, Version, Selector]" --output text
db.example.com 1 :stable
If you attach the same label to a different version, the label moves. If you omit --parameter-version, it attaches to the latest version. A reader that keeps using :stable unchanged gets the new value.
$ aws ssm label-parameter-version --name /example/app/db/host --labels stable
{
"InvalidLabels": [],
"ParameterVersion": 2
}
$ aws ssm get-parameter --name /example/app/db/host:stable --query "Parameter.[Value, Version, Selector]" --output text
db2.example.com 2 :stable
$ aws ssm get-parameter-history --name /example/app/db/host --query "Parameters[].{Version: Version, Labels: Labels}"
[
{
"Version": 1,
"Labels": []
},
{
"Version": 2,
"Labels": [
"stable"
]
}
]
The official documentation says labels cannot start with a number, aws, or ssm, and a label that does not meet the rules is not attached and is returned in InvalidLabels. When I tried to attach 1st, the command succeeded (exit code 0), but 1st was returned in InvalidLabels. A script that attaches labels must check whether InvalidLabels is empty, not just the exit code.
$ aws ssm label-parameter-version --name /example/app/db/host --labels 1st
{
"InvalidLabels": [
"1st"
],
"ParameterVersion": 2
}
Pointing to a version that does not exist returned ParameterVersionNotFound. The official documentation also states that specifying a nonexistent version fails and does not fall back to the latest value.
$ aws ssm get-parameter --name /example/app/db/host:3
aws: [ERROR]: An error occurred (ParameterVersionNotFound) when calling the GetParameter operation: Systems Manager could not find version 3 of /example/app/db/host. Verify the version and try again.
Deleting parameters, and what happens when the emulator stops
To delete one parameter, use delete-parameter. To delete several, use delete-parameters. delete-parameter printed nothing on success. delete-parameters returned the deleted names and the names that were not found separately, even when some names did not exist.
$ aws ssm delete-parameter --name /example/app/log-level
$ aws ssm get-parameter --name /example/app/log-level
aws: [ERROR]: An error occurred (ParameterNotFound) when calling the GetParameter operation:
$ aws ssm delete-parameters --names /example/app/features /example/app/nothing
{
"DeletedParameters": [
"/example/app/features"
],
"InvalidParameters": [
"/example/app/nothing"
]
}
$ aws ssm get-parameters-by-path --path /example/app --recursive --query "Parameters[].Name"
[
"/example/app/db/host",
"/example/app/db/password"
]
As described in the official documentation's limitations section, AWS Emulator keeps resources in memory and clears everything when stopped. After I stopped the emulator and started it again, the two remaining parameters were gone.
$ aws ssm get-parameters-by-path --path /example/app --recursive --query "Parameters[].Name"
[]
When you use this in tests, prepare a procedure that runs put-parameter to load the parameters you need each time after starting the emulator.





