Skip to content

aws-stepfunctions-tasks.apigateway: cross-region RestAPI not supported #26509

Open
@kiwi-33

Description

@kiwi-33

Describe the bug

CDK builds an endpoint URL using the region of the Stack. This is a problem when I want to call a Rest API that is in a different region from the StepFunction.

Expected Behavior

From a StepFunction in region-A, I can invoke a RestAPI in region-B.

Current Behavior

API Endpoint is always the same region as the stack

https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/apigateway/call-rest-api.ts#L68 (it is built without consideration for the region.)

Reproduction Steps

this is the default behavior of the CallApiGatewayRestApiEndpoint class.

Possible Solution

restApiRegion can be passed as an optional parameter and is used when building the URL in the getApiEndpoint() method.

Additional Information/Context

No response

CDK CLI Version

2.88.0

Framework Version

No response

Node.js Version

v16.20.0

OS

MacOS Darwin

Language

Typescript

Language Version

4.9.5

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions