-
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
(@aws-cdk/aws-stepfunction-tasks): Unnecessary validation of field "Headers" in CallApiGatewayRestApiEndpoint #14181
Comments
From this ticket: #14184, apparently you need to put headers: TaskInput.fromObject({ TaskToken: `States.Array(${JsonPath.taskToken})` }), If you find that hard to read, it's the same as: headers: TaskInput.fromObject({ TaskToken: 'States.Array(' + JsonPath.taskToken +')' }), |
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*
The validation of Header property in constructor of CallApiGatewayRestApiEndpoint is unnecessary as StepFunction UI (i.e Amazon States Language) allows
apigateway:invoke.waitForTaskToken
without "Header" property.Also, as per HttpHeaderDeserializer in StepFunctionsHttpConnectors , Headers property is deserialized as
Map<String, List<String>>
. Constructing this structure in CDK with JsonPath is currently not possible.This validation is enforcing to add
headers: TaskInput.fromObject({ TaskToken: JsonPath.taskToken)
in CallApiGatewayRestApiEndpoint props. When task with this configuration is deployed and run in AWS StepFunction it throws errrorparameter could not be used to start the Task: [The value of the field 'Headers' has an invalid format]"
Reproduction Steps
create Task, and deploy it. Try to run this stepFunction.
What did you expect to happen?
Task should make a call to the ApiGateway
What actually happened?
Exception during task execution
parameter could not be used to start the Task: [The value of the field 'Headers' has an invalid format]"
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: