Skip to content

aws-stepfunctions-tasks: workerType not dynamic from payload #32359

@ElearG

Description

@ElearG

Describe the bug

I want to implement a state machine that invokes a glue job synchronously and that at the time of invoking it, the type of worker and the number of workers are passed as parameters from the input (payload). It is verified that the implementation can be achieved at the console level, however, if I want to deploy it through CDK, it is not possible, because the value of "WorkerType" is a class of the WorkerType type and does not allow it to be placed dynamically from the input. A capture of the implementation in the console and the attempt at implementation in CDK are attached.

  • Only can set the workers' number dynamic from payload

CDK Repository Implementation
image

  • To make dynamic the workerType the workerType should look something like this:

image

- But here the error:

image

  • When implenet by console looks likes :

image

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

Define in CDK the workerType to be dynamic from the payload input in the state machine, in other words, achieve the image but doing it with cdk.
I need that the argument "worker_type" not only accept a WorkerType Class that is a enum and only can put the define workers type insted of i need that also accept strings to pass "_sfn.JsonPath.string_at('$.glue_jobs_configs.executor_type')"in that argument

image

Current Behavior

Now, I can't put the workers type dynamic from payload input in the state machine because it only accept a class workerType that its a enum and only accepts the define workers.
If i pass a string that references the payload input it shows an error.

image
image

Reproduction Steps

In the step function task: GlueStartJobRun
Put the argument worker_type the value _sfn.JsonPath.string_at('$.glue_jobs_configs.executor_type')
worker_type= _sfn.JsonPath.string_at('$.glue_jobs_configs.executor_type')
image

Possible Solution

The argument worker_type accept also strings and dont validate that its only a class WorkerType

Additional Information/Context

No response

CDK CLI Version

2.171.1

Framework Version

No response

Node.js Version

20.11.1

OS

Windows 11

Language

Python

Language Version

3.11

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions