AWS Automation Document: How do I iterate over output from a previous step using aws:loop?

59 Views Asked by At

Using the aws:loop has been clear as mud, especially as it relates to using an output from a previous step as input for this step.

I have a step (uses this: AWS-RunPowerSHellScript) that outputs an array (I have also tried tables too). An example of this array would be a list of filenames:

a.file, b.file, c.file

the JSON as:

      "outputs": [
        {
          "Type": "StringList",
          "Name": "Name",
          "Selector": "$.Payload"
        }

I need to iterate over that list in an aws:loop step, but no matter how I adjust output - I always get a "Failed to resolve Name.Output to type StringList."

the JSON as:

     "name": "Loop",
      "action": "aws:loop",
      "nextStep": "NextStep",
      "isEnd": false,
      "inputs": {
        "Iterators": "{{ Name.Output }}",
        "IteratorDataType": "StringList",
        "Steps": [ ...

Does anyone know how I can iterate over Name.Output using aws:loop? Or, how I need to adjust the data type/data in the step with output?

0

There are 0 best solutions below