Using the Parameter Store extension in AWS Systems Manager Cloud Extensions
The extension serves the Systems Manager API of Parameter Store at the endpoint http://localhost:5333/parameterstore. Every request is an HTTP POST to that endpoint in the AWS JSON 1.1 protocol of Systems Manager. The X-Amz-Target header names the operation, such as AmazonSSM.GetParameter, and the body is the JSON input of the operation. The SSM client of an AWS SDK, and the AWS CLI, send these requests for you when you give them the endpoint.
Authentication
Sign each request with Signature Version 4 for the service ssm. Use the extension key of the profile as the credentials: its access key ID and its secret key. The runtime checks the signature. The extension then calls Parameter Store with its own role, not with the extension key. An SDK or the AWS CLI signs the requests when you give it the extension key as its credentials. For curl, use the --aws-sigv4 option.
The runtime rejects a request without a signature, or with a signature that doesn't match, with 400 AccessDeniedException. The cloudextensions-error-reason header holds the reason, such as MISSING_AUTHENTICATION or SIGNATURE_MISMATCH.
Operations
The extension has two read-only operations. They share the same cache entries, so a value that one operation fetches serves the other.
| Operation | X-Amz-Target |
Returns | Use it when |
|---|---|---|---|
|
GetParameter |
|
The Parameter Store |
You read one parameter. |
|
GetParameters |
|
The Parameter Store |
You read up to 10 parameters at once. |
The extension serves no other operation of Systems Manager. A request for another operation, such as PutParameter or GetParametersByPath, fails with 400 ValidationException and the message No operation matches the request.
GetParameter calls Parameter Store GetParameter only on a cache miss. A cache miss means that the parameter isn't cached yet or that its cached entry is stale. The extension returns a fresh cached entry without calling Parameter Store. The call to Parameter Store can fail for a transient reason, such as throttling. If the cache holds a value for the parameter, the extension then returns the cached value instead, even after its TTL, and treats it as fresh for another TTL.
GetParameters answers from the cache without calling Parameter Store only when every name in the request is fresh in the cache. Otherwise, the extension sends every name in the request, the fresh ones too, to Parameter Store in one GetParameters call. The extension returns the answer of Parameter Store. The call can fail for a transient reason, such as throttling. If every name has a cached value, the extension then returns the cached values instead, even values past their TTL, and treats them as fresh for another TTL. For more information, see How GetParameters uses the cache.
Request parameters
The request parameters are those of Parameter Store, in the JSON body of the request. The extension has no request parameter for the AWS Region. It reads every parameter in the Region of the runtime.
GetParameter takes the following parameters:
| Parameter | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
|
|
string |
Yes |
None |
1 to 2,048 characters |
The parameter name, such as |
|
|
boolean |
No |
|
|
Return a SecureString value decrypted. Without this parameter, you get the encrypted value. The role needs |
GetParameters takes the following parameters:
| Parameter | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
|
|
list of strings |
Yes |
None |
1 to 10 names. Each name has 1 to 2,048 characters. |
The parameter names, ARNs, or names with a |
|
|
boolean |
No |
|
|
Return every SecureString value decrypted. The role needs |
Response shapes
The status of a successful response is 200 OK, and the Content-Type is application/x-amz-json-1.1. The body is the response of Parameter Store, with its member names and types. For example, ARN is in capital letters, and LastModifiedDate is a number of epoch seconds with milliseconds. An SDK turns LastModifiedDate into the date type of its language.
GetParameter
The following example shows the body of a GetParameter response.
{ "Parameter": { "ARN": "arn:aws:ssm:us-west-2:111122223333:parameter/my-app/db-host", "DataType": "text", "LastModifiedDate": 1795637952.77, "Name": "/my-app/db-host", "Type": "String", "Value": "db.example.com", "Version": 1 } }
The Parameter object has the following members.
| Member | Type | Always present | Notes |
|---|---|---|---|
|
|
string |
Yes |
The name of the parameter. |
|
|
string |
Yes |
The value of the parameter. A |
|
|
string |
No |
|
|
|
long |
No |
The version of the parameter. |
|
|
string |
No |
The |
|
|
string |
No |
For a Secrets Manager reference through |
|
|
timestamp |
No |
Epoch seconds with a fraction, such as |
|
|
string |
No |
The ARN of the parameter. |
|
|
string |
No |
|
If Parameter Store leaves a member out of its response, the extension leaves the member out too.
GetParameters
The body is the GetParameters response of Parameter Store, with nothing added. Both lists are always present.
{ "InvalidParameters": [ "/my-app/does-not-exist" ], "Parameters": [ { "ARN": "arn:aws:ssm:us-west-2:111122223333:parameter/my-app/api-url", "DataType": "text", "LastModifiedDate": 1795637953.606, "Name": "/my-app/api-url", "Type": "String", "Value": "https://api.example.com", "Version": 1 }, { "ARN": "arn:aws:ssm:us-west-2:111122223333:parameter/my-app/db-host", "DataType": "text", "LastModifiedDate": 1795637952.77, "Name": "/my-app/db-host", "Type": "String", "Value": "db.example.com", "Version": 1 } ] }
The response has the following members.
| Member | Type | Notes |
|---|---|---|
|
|
list of parameters |
The parameters that the extension read, sorted by |
|
|
list of strings |
The requested names without a value, sorted. These are the names that Parameter Store reports as not valid. For example, a parameter that doesn't exist, a version or label that doesn't exist, or a SecureString whose AWS Key Management Service (AWS KMS) key is disabled. |
A name that doesn't exist doesn't fail the request. The extension lists the name in InvalidParameters, and the status is still 200 OK.
AWS CLI examples
These examples read the parameters /my-app/db-host and /my-app/api-url, which are String parameters, and /my-app/db-password, which is a SecureString parameter. Replace them with the names of your own parameters. Run the examples while the runtime serves the extension. Use the extension key of the profile as the credentials of the AWS CLI:
export AWS_ACCESS_KEY_ID=extension-access-key-idexport AWS_SECRET_ACCESS_KEY=extension-secret-keyexport AWS_REGION=us-west-2 E=http://localhost:5333/parameterstore
Then run the following commands:
# One parameter (GetParameter) aws ssm get-parameter --endpoint-url $E --name /my-app/db-host # Only the value aws ssm get-parameter --endpoint-url $E --name /my-app/db-host --query Parameter.Value --output text # Several parameters (GetParameters) aws ssm get-parameters --endpoint-url $E --names /my-app/db-host /my-app/api-url # A SecureString, decrypted aws ssm get-parameter --endpoint-url $E --name /my-app/db-password --with-decryption
For examples with curl, see Examples with curl for the Parameter Store extension in AWS Systems Manager Cloud Extensions. For an example with the AWS SDK for Python (Boto3), see Lambda function example for the Parameter Store extension in AWS Systems Manager Cloud Extensions.