https://www.terraform.io/docs/configuration/functions/formatdate.html
Th above is the doc of this function, I used this to append a timestamp on a name of the SageMaker batch transform job, which will be triggered from a stepfunction state machine:
locals {
timestamp = formatdate("YYYYMMDDhhmmss", timestamp())
}
in stepfunction terraform file:
definition = templatefile("stepfuntion.json",
{
xxx
timestamp = local.timestamp
)
in the "stepfuntion.json":
{...
"TransformJobName": "jobname-${timestamp}",
}
},
"End": true
}
}
}
Specifically, the jobname is defined in "TransformJobName": "jobname-${timestamp}"
,
I applied terraform twice, 10am and 11am, but the second time it generated the same timestamp as the first time, am I missing something here? I thought this function will generate the real-time timestamp. I've been struggling for a whole morning now, many thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…