I'm trying to set up an EMR step from the CDK (typescript), using a variable from the state context object as a parameter, but I can't get it to work.
Here's what I tried:
const emrTask = new EmrAddStep(
stack,
name,
{
name: name,
jar: jar,
args: [
'--arg_1',
'$$.Execution.StartTime',
],
clusterId: clusterId,
}
);
During the state run $$.Execution.StartTime does not get replaced by the actual value.
I also tried this:
const emrTask = new EmrAddStep(
stack,
name,
{
name: name,
jar: jar,
args: [
'--arg_1',
JsonPath.stringAt('$$.Execution.StartTime')
],
clusterId: clusterId,
}
);
But I get this error:
Error: Cannot use JsonPath fields in an array, they must be used in objects