How to read ssm parameters in a shell script in aws data pipeline?

678 Views Asked by At

I'm setting up a data pipeline in aws. and plan to use a "getting started using ShellCommandActivity" template to run a shell script. how can i pass credentials stored in ssm parameter as a parameter to this script.

1

There are 1 best solutions below

0
On

I haven't verified that, but ShellCommandActivity is similar to ShellScriptConfig from what I can tell. Based on the examples provided for these commands, I would think that you could pass the ssm param name as follows:

{
  "id" : "CreateDirectory",
  "type" : "ShellCommandActivity",
  "command" : "your-script.sh <name-of-your-parameter>"
}

or

{
  "id" : "CreateDirectory",
  "type" : "ShellCommandActivity",
  "scriptUri" : "s3://my-bucket/example.sh",
  "scriptArgument" : ["<name-of-your-parameter>"]
}

and in the example.sh you would use $1 to refer to the value of the argument passed.