-
Notifications
You must be signed in to change notification settings - Fork 4k
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
"Calling API gateway using Stepfunctions" feature is not properly supported by CDK, when using CallApiGatewayRestApiEndpoint #14184
Comments
This bug is exactly similar to this issue. |
@paraspra We need header field for the task token |
You must use The code probably needs to look like this: headers = aws_stepfunctions.TaskInput.from_object({
"TaskToken.$":"States.Array(" + aws_stepfunctions.JsonPath.task_token + ")"
}) |
Nevermind, this does not work. |
…teway To pass the Task Token in headers to an API Gateway, the token must be wrapped in an array (because that's the value type of headers). Because JSONPath evaluation needs to happen to resolve the token, we need to use the `States.Array()` function in a `JsonPathToken` to properly resolve this. However, doing that makes the existing validation code fail the validation checking that you are passing the task token somewhere. Add convenience methods for the intrinsics, and update the checker to also find paths referenced inside intrinsic functions. Fixes #14184, fixes #14181.
…teway (#18595) To pass the Task Token in headers to an API Gateway, the token must be wrapped in an array (because that's the value type of headers). Because JSONPath evaluation needs to happen to resolve the token, we need to use the `States.Array()` function in a `JsonPathToken` to properly resolve this. However, doing that makes the existing validation code fail the validation checking that you are passing the task token somewhere. Add convenience methods for the intrinsics, and update the checker to also find paths referenced inside intrinsic functions. Fixes #14184, fixes #14181. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…teway (aws#18595) To pass the Task Token in headers to an API Gateway, the token must be wrapped in an array (because that's the value type of headers). Because JSONPath evaluation needs to happen to resolve the token, we need to use the `States.Array()` function in a `JsonPathToken` to properly resolve this. However, doing that makes the existing validation code fail the validation checking that you are passing the task token somewhere. Add convenience methods for the intrinsics, and update the checker to also find paths referenced inside intrinsic functions. Fixes aws#14184, fixes aws#14181. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…teway (aws#18595) To pass the Task Token in headers to an API Gateway, the token must be wrapped in an array (because that's the value type of headers). Because JSONPath evaluation needs to happen to resolve the token, we need to use the `States.Array()` function in a `JsonPathToken` to properly resolve this. However, doing that makes the existing validation code fail the validation checking that you are passing the task token somewhere. Add convenience methods for the intrinsics, and update the checker to also find paths referenced inside intrinsic functions. Fixes aws#14184, fixes aws#14181. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
We are trying to use the CallApiGatewayRestApiEndpoint construct with WAIT_FOR_TASK_TOKEN integration pattern. Per the AWS docs on the contract, we need to specify the headers like this:
"Headers": { "TaskToken.$": "States.Array($$.Task.Token)" }
However, we're not sure how to do that with the CallApiGatewayRestApiEndpoint construct. We tried something like this, which would generate the expected headers:
but when we set IntegrationPattern to WAIT_FOR_TASK_TOKEN, CDK complains that task token is missing:
Task Token is required in headers for WAIT_FOR_TASK_TOKEN pattern. Use JsonPath.taskToken to set the token.
But if we make the value of the header field a string instead of list/array, then CDK wouldn't raise an error. however when we execute this state machine, step functions would complain that the format of header field is incorrect.
Reproduction Steps
Described above
What did you expect to happen?
CDK shouldn't complain when we pass Task Token using States.Array within headers and when we use WAIT_FOR_TASK_TOKEN pattern.
What actually happened?
Seems like for calling API gateway using stepfunctions, we need to pass task token within array inside the header. But CDK doesn't detect task token if we do this way. Also, note that CDK currently doesn't support intrinsic functions (Such as States.Array).
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: