Access AWS SSM via AWS Stepfunctions
Configuration will be availble throughout the pipeline, if that can be stored in the AWS Stepfunctions. Generally congiruation should be stored in the SSM parameter store. How to access the SSM parameter store from the AWS Stepfunction?
For example, using AWS CLI, store the in the AWS SSM parameter store:
aws ssm put-parameter --name "/my/config" --type String --overwrite --value file://configurations/ssm/config.json
In the above command, the configurations
is a immideate sub folder. The config.json contain your json type configuration.
You need to access the above parameter in the ASL code as follows:
{
"Type": "Task",
"Parameters": {
"Names": [
"/my/config"
]
},
"Resource": "arn:aws:states:::aws-sdk:ssm:getParameters",
"ResultSelector": {
"ssm-parameters.$": "$.Parameters"
},
"End": true
}
Please refer to the AWS SDK service integrations for more information.
Although it is simple, you have to specify the IAM role policy as follows:
Statement:
- Effect: Allow
Action:
- ssm:DescribeParameters
Resource: '*'
- Effect: Allow
Action:
- ssm:GetParameters
Resource:
- !Sub arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/my/config
please see for more information.