Skip to content
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

stepfunction's CallApiGatewayHttpApiEndpointOptions should NOT tightly coupled with target api stack? #33506

Open
1 task
garyy7811 opened this issue Feb 19, 2025 · 1 comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@garyy7811
Copy link

Describe the bug

`
/**

  • Base properties for calling an HTTP API Endpoint
    /
    export interface CallApiGatewayHttpApiEndpointOptions {
    /
    *
    • The Id of the API to call
      */
      readonly apiId: string;

/**

  • The Stack in which the API is defined
    */
    readonly apiStack: cdk.Stack;

/**

  • Name of the stage where the API is deployed to in API Gateway
  • @default '$default'
    */
    readonly stageName?: string;
    }`

readonly apiStack: cdk.Stack; I'm confused why we need to pass a code reference to the stack where the api is defined,

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

program design, code review should be conducted or add more comments to make sure user understand

Current Behavior

api caller is tightly coupled to callee on code ref level

Reproduction Steps

just take a look

Possible Solution

program design, code review should be conducted or add more comments to make sure user understand

Additional Information/Context

No response

CDK CLI Version

2.178.2

Framework Version

No response

Node.js Version

node20

OS

ubuntu

Language

TypeScript

Language Version

No response

Other information

this is one of the core modules, please do QA on each level

@garyy7811 garyy7811 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 19, 2025
@github-actions github-actions bot added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Feb 19, 2025
@pahud
Copy link
Contributor

pahud commented Feb 19, 2025

I think the reason is to construct this:

private getApiEndpoint(): string {
const apiStack = this.props.apiStack;
return `${this.props.apiId}.execute-api.${apiStack.region}.${apiStack.urlSuffix}`;
}

but I think actually we could get the stack using

Stack.of(this) if CallApiGatewayHttpApiEndpoint is in the same scope with the api.

Requesting the team for further inputs.

@pahud pahud added p3 p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. p3 labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants