在AWS步骤函数定义中,如何将参数传递到属性数组中



使用下面的步骤函数状态定义,我想引用我在命令运行器参数中传递给它的月份、日期、年份参数。现在,联接的计算结果出乎意料地为"--src=s3://arn:aws:s3::: bababucketName/$.YEAR/$.MONTH/$.DAY/"。有没有办法在云形成函数中使用阶跃函数参数?

"CopyFromS3": {
"Type": "Task",
"Resource": "arn:aws:states:::elasticmapreduce:addStep.sync",
"Parameters": {
"ClusterId.$": "$.cluster.ClusterId",
"Step": {
"Name": "CopyFromS3",
"HadoopJarStep": {
"Jar": "command-runner.jar",
"Args": [
"s3-dist-cp",
{
"Fn::Join" : [ "", [ 
"--src=s3://",
{ "Ref": "VehicleDataBucket" },
"telemetry/",
"$.YEAR",
"/",
"$.MONTH",
"/",
"$.DAY",
"/"
]
]
},
"--dest=hdfs:///output"
]
}
}
},

请看一下States.Array内部函数。https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html

此外,AWS刚刚发布了这个新工具,使开发工作流变得更容易。这将帮助您编写状态机定义。https://docs.aws.amazon.com/step-functions/latest/dg/workflow-studio.html

最新更新