0

Below is my statemachine resource template. Failing with template failed variable SubnetsParameter in Fn::Sub expression doesn't resolve to string. Any help would be appreciated.

DefinitionString: !Sub |
  {
    "Comment": "A State Machine to invoke ECS Fargate with Security Groups and Subnet from SSM",
    "StartAt": "RunEcsTask",
    "States": {
      "RunEcsTask": {
        "Type": "Task",
        "Resource": "arn:aws:states:::ecs:runTask.sync",
        "Parameters": {
          "Cluster": "${EcsClusterArn}",
          "TaskDefinition": "${EcsTaskDefinitionArn}",
          "LaunchType": "FARGATE",
          "NetworkConfiguration": {
            "AwsvpcConfiguration": {
              "Subnets": ${SubnetsParameter},
              "SecurityGroups": [
                "${SecurityGroupParameter1}",
                "${SecurityGroupParameter2}",
                "${SecurityGroupParameter3}",
                "${SecurityGroupParameter4}"
              ],
              "AssignPublicIp": "ENABLED"
            }
          },
          "Overrides": {
            "ContainerOverrides": [
              {
                "Name": "${ContainerName}"
              }
            ]
          }
        },
        "End": true
      }
    }
  }
1
  • Can you try putting string "true", like this "End": "true" -> instead of "End": true Commented Mar 5 at 5:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.