aws / aws/aws-cdk

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

Open
#26,509 1 comment 5 reactions 0 assignees View on GitHub
@aws-cdk/aws-stepfunctions-tasks effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
71

Description

### 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_

Contributor guide

Open the contributing guide

Research direction

Start in packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/apigateway/call-rest-api.ts, especially the getApiEndpoint() method and the CallApiGatewayRestApiEndpoint class. Trace how the endpoint region is currently obtained, then verify that an optional restApiRegion can control cross-region URLs while the existing default behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
api, cloud
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.