-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stepfunctions: CDK to CFN template is serializing incorrectly #26111
Labels
@aws-cdk/aws-stepfunctions
Related to AWS StepFunctions
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Comments
srivastavr
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Jun 26, 2023
reference from CFN : aws-cloudformation/cloudformation-coverage-roadmap#1722 |
This is the code I used to reproduce this issue export class Demo2Stack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const obj = {
key1: [
[
{
key2: {
key3: 'value1',
},
key4: [
[
{
key5: {
key6: 'value2',
},
},
],
],
},
],
],
}
const payload = sfn.TaskInput.fromObject(obj)
const invoke = new sfntasks.LambdaInvoke(this, 'Invoke Func', {
lambdaFunction: getLambdaFunction(this),
payload,
});
new sfn.StateMachine(this, 'StateMachine', {
definition: invoke,
})
new CfnOutput(this, 'input', { value: JSON.stringify(payload) })
};
}; I can confirm the CfnOutput is serialized correctly:
But the state machine DefinitionString is not serialized correctly:
|
pahud
changed the title
CDK to CFN template is serializing incorrectly
stepfunctions: CDK to CFN template is serializing incorrectly
Jun 26, 2023
pahud
added
effort/medium
Medium work item – several days of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Jun 26, 2023
peterwoodworth
added
@aws-cdk/aws-stepfunctions
Related to AWS StepFunctions
and removed
@aws-cdk/aws-lambda
Related to AWS Lambda
labels
Jun 26, 2023
This was referenced Jul 26, 2023
Hi, Any updates ? |
Hello @srivastavr, maybe this PR has solved the problem. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-stepfunctions
Related to AWS StepFunctions
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
Issue Description
Hi,
We are passing
array of array
in payload from step function to a lambda function, below is the sample codebut after building, the cloud formation template converts this into array of objects with
0
index at places which is incorrect.like this
Expected Behavior
Observed Behavior
Test Cases
NA
Other Details
No response
Expected Behavior
Current Behavior
Reproduction Steps
building the typescript code
Possible Solution
The serialization is implemented in CDK:
aws-cdk/packages/aws-cdk-lib/aws-stepfunctions/lib/input.ts
Lines 21 to 23 in a79794e
Additional Information/Context
No response
CDK CLI Version
"aws-cdk": "^2.72.0"
Framework Version
No response
Node.js Version
NodeJS/releases/default.331411.0
OS
Linux
Language
Typescript
Language Version
"typescript": "^4.9.4"
Other information
No response
The text was updated successfully, but these errors were encountered: