AWS Step Functions released support for Parameters option in the input definition.
CDK should be able to define this attribute:
const initalTask = new stepfunctions.Task(this, "InitialTask", {
resource: asyncLambda,
parameters: {
"task.$": "$.task"
}
inputPath: "$",
outputPath: "$.state"
}).next(nextTask);
In the mean time, I hope you are aware you can use CloudFormation overrides to work around the lack of support for now.
I could not use the CloudFormation overrides because what I need is a property (on TaskProps) that will end up as a JSON object. I got it to work for now with this:
interface ParameterizedTaskProps extends sf.TaskProps {
parameters: any;
}
class ParameterizedTask extends sf.Task {
private parameterizedProps: ParameterizedTaskProps;
constructor(parentConstruct: cdk.Construct, id: string, parameterizedProps: ParameterizedTaskProps) {
super(parentConstruct, id, parameterizedProps);
this.parameterizedProps = parameterizedProps;
}
public toStateJson(): object {
const stateJson = {
...super.toStateJson(),
Parameters: this.parameterizedProps.parameters
};
return stateJson;
}
}
You are right, of course. Sorry!
commit d0c52832ec4df8e49f9ddef4bc8b8032019b54df has removed this... can this issue be reopened?
I'm unable to set Parameters on Step Functions tasks in CDK v1.3.
Can this issue be reopened?
Most helpful comment
commit d0c52832ec4df8e49f9ddef4bc8b8032019b54df has removed this... can this issue be reopened?