aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

AWS Step Functions Tasks - HttpInvoke: Bug in code example

Open DennisTraub opened this issue 1 year ago • 1 comments

Describe the issue

The value passed into the api_endpoint parameter in the code example does not work and leads to an error. It doesn't accept the full url, it must be the path, relative to the value in apiRoot.

// Is:

tasks.HttpInvoke(self, "Invoke HTTP API",
    api_root="https://api.example.com",
    api_endpoint=sfn.TaskInput.from_text("https://api.example.com/path/to/resource"),
    ...
)

// Should be:

tasks.HttpInvoke(self, "Invoke HTTP API",
    api_root="https://api.example.com",
    api_endpoint=sfn.TaskInput.from_text("path/to/resource"),
    ...
)

Links

API Reference / aws_cdk.aws_stepfunctions_tasks / HttpInvoke

DennisTraub avatar Jul 24 '24 17:07 DennisTraub

Example appears to be incorrect. The documentation states that api_endpoint (TaskInput) is The API endpoint to call, relative to apiRoot.

ashishdhingra avatar Jul 24 '24 18:07 ashishdhingra

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

github-actions[bot] avatar Sep 08 '24 07:09 github-actions[bot]

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

github-actions[bot] avatar Sep 08 '24 07:09 github-actions[bot]