Is the Version of a Step Function available from Step Function Context

0

The Context object available from a Step Function is described here, but there isn't a mention of Versions. If Versions are used is the executing Version visible in the Step Function Context object (either as a seperate field or as part of the StateMachine.Id)?

已提問 8 個月前檢視次數 269 次
2 個答案
2
已接受的答案

It seems it is not shown in the context object. I will raise it with the service team.

profile pictureAWS
專家
Uri
已回答 8 個月前
  • BTW, why do you need it?

    In the meantime, you can use DescribeExceution or GetExecutionHistory to get the information.

  • I'm looking at doing a consistency check between the version of the Step Function that's running and the version of the Lambdas it's executing, and if the Step Function included this in context as Lambda does then this would be a convenient and performant way to do it

1

Hi,

The way to obtain the version of a state machine is to use API DescribeStateMachine in the Step AWS SDK of your favorite language : https://docs.aws.amazon.com/step-functions/latest/apireference/API_DescribeStateMachine.html

It's called revisionId in the returned Json:

{
   "creationDate": number,
   "definition": "string",
   "description": "string",
   "label": "string",
   "loggingConfiguration": { 
      "destinations": [ 
         { 
            "cloudWatchLogsLogGroup": { 
               "logGroupArn": "string"
            }
         }
      ],
      "includeExecutionData": boolean,
      "level": "string"
   },
   "name": "string",
   "revisionId": "string",
   "roleArn": "string",
   "stateMachineArn": "string",
   "status": "string",
   "tracingConfiguration": { 
      "enabled": boolean
   },
   "type": "string"
}

Best,

Didier

profile pictureAWS
專家
已回答 8 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南