title: AWS Step Function Get Details/ARN of running Task
body: <p>I am starting a state machine from a python file. The State machine starts a ECS Fargate Task. While the State Machine is running, in my python file can I access the ARN/Details of the running ECS Fargate Task.
  Thanks.</p>
  <p>Update here is Python Code snippet:</p>
  <pre><code>def main():
      client = boto3.client('stepfunctions')
      
      #For the purpose of this snippet forcing if case to always run
      num = 1
      if num == 1:
          #start state Machine execution
          response = client.start_execution(
              stateMachineArn='arn:aws:states:us-west-2:1234567890:stateMachine:stateMachine',
              input='{&quot;in_put&quot;: &quot;{totalPartitionCount:3}&quot;}'
          )
  
      while True:
          time.sleep(2) 
   
          #Describe State Machine execution while its running
          sf_response = client.describe_execution(executionArn=response['executionArn'])
          status = sf_response['status'] 
  
  # In this loop i am getting state Machine status every 2 seconds. 
  # is it also possible to get the ARN/details of my ECS Task from my state machine execution here. 
  # I want to use the ECS API to print details about the ECS task in this loop as well.
  
          if status == 'RUNNING':
              print(&quot;%s: %s&quot; % (&quot;&gt; Status...&quot;, status))
              continue
          elif status == 'FAILED':
              sys.exit()
              raise Exception(&quot;%s: %s&quot; % (&quot;! ERROR ! Execution FAILED: &quot;, sf_response))
          else:
              # SUCCEEDED, ABORTED, ANY OTHER STATE
              print(json.dumps(sf_response, indent=4, sort_keys=True, default=str))
              break
  
      #At this point state machine execution has finished print output
      print(&quot;--------------------------------------------------&quot;)
      print(json.dumps(sf_response['output'], indent=4, sort_keys=True, default=str))
      print('--------------------------------------------------')
  </code></pre>