How to append stepfunction execution id to SageMaker job names?

心不动则不痛 提交于 2021-01-20 13:16:09

问题


I have a step function statemachine which creates SageMaker batch transform job, the definition is written in Terraform, I wanted to add the stepfunction execution id to the batch transform job names:

in stepfunction terraform file:

  definition = templatefile("stepfuntion.json",
    {
      xxxx
)

in the "stepfuntion.json":

{...
          "TransformJobName": "jobname-$$.Execution.Id",
  
          }
      },
        "End": true
      }
    }
  }

But after terraform apply, it didn't generate the actual id, it gave me jobname-$$.Execution.Id, can anyone help with this please?

Resources: https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html "To access the context object, first specify the parameter name by appending .$ to the end, as you do when selecting state input with a path. Then, to access context object data instead of the input, prepend the path with $$.. This tells AWS Step Functions to use the path to select a node in the context object."

Can someone tell me what I'm missing please?


回答1:


The var you are trying to use terraform doesn't know about it

jobname-$$.Execution.Id.

That's something specific to the Step function and available within state machine not available for terraform.



来源:https://stackoverflow.com/questions/65609804/how-to-append-stepfunction-execution-id-to-sagemaker-job-names

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!