Skip to content

GetParameter

Source: src/AWS/SSM/GetParameter.ts

Runtime binding for ssm:GetParameter.

Bind this operation to a Parameter inside a function runtime to get a callable that automatically injects the parameter name. For SecureString parameters the binding also grants kms:Decrypt on the parameter’s encryption key so WithDecryption: true works out of the box.

Read a String Parameter

const getParameter = yield* SSM.GetParameter(config);
const result = yield* getParameter();
const value = result.Parameter?.Value;

Read a SecureString Parameter with Decryption

const getSecret = yield* SSM.GetParameter(apiKey);
const result = yield* getSecret({ WithDecryption: true });