Closed tonyhoo closed 4 years ago
Hi @tonyhoo!
Thank you for contributing! I just wanted to let you know, we are working hard to stabilize the CDK APIs and tuning them to meet our consistency guidelines. While we work on getting the APIs aligned with our guidelines, we are pausing work on most community feature-requests. We expect to get back to work on community feature-requests within a few weeks.
Hi @tonyhoo
Thank you for your feedback.
For information, we do not detect reference path given in a literal string today. To declare a reference path, users should use transformJobName: sfn.Data.stringAt('$.jobName')
.
Reference:
https://github.com/awslabs/aws-cdk/blob/921dcc9f9f569331467a924ca4d849e501a3a557/packages/%40aws-cdk/aws-stepfunctions-tasks/test/sagemaker-transform-job.test.ts#L145
Thanks @wqzoww , tried it out and works fine. Great! Is this gotcha captured anywhere in CDK documentation in case anyone else encounter the same problem?
@tonyhoo - we have this documented here - https://docs.aws.amazon.com/cdk/api/latest/docs/aws-stepfunctions-readme.html#task-parameters-from-the-state-json
I'm submitting a ...
What is the current behavior? The
$.
syntax for nested parameter won't work. For examplenew sfn_tasks.SagemakerTransformTask(this, {transformJobName: "$.jobName"});
will result in failure due to name regex validation error during execution. The reason is that when converting to cloudformation, it won't suffix parameter name with.$
which is required for nested field per ASL definitionWhat is the expected behavior (or behavior of feature suggested)? Automatically detect such use case and convert to cfn correctly
What is the motivation / use case for changing the behavior or adding this feature? There are lots of use cases require dynamic loading parameters from workflow shared context per execution. For example, SageMaker enforces the
transformJobName
to be unique everytime, so there is a strong need to create new/dynamic jobName per execution instead of using hard coded valuePlease tell us about your environment: