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

apigateway: StepFunctionsIntegrations add default methodResponses #27520

Closed
2 tasks
redvex opened this issue Oct 12, 2023 · 2 comments · Fixed by #27645
Closed
2 tasks

apigateway: StepFunctionsIntegrations add default methodResponses #27520

redvex opened this issue Oct 12, 2023 · 2 comments · Fixed by #27645
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@redvex
Copy link

redvex commented Oct 12, 2023

Describe the feature

When StepFunctionsIntegrations is used, it creates methodResponses for 200, 400 and 500 and it's not possible to override this behaviour.

Use Case

When custom responses are provided they may clash with default ones.
For example one may want setup a different responseTemplate from the one provided.
For example I have a state machine that returns an URL and my responseTemplate set the http status to 302.

Proposed Solution

Adding a useDefaultMethodResponses?: boolean prop (default true) to the StepFunctionsExecutionIntegrationOptions interface to avoid adding default responses:

https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-apigateway/lib/integrations/stepfunctions.ts#L160

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.100

Environment details (OS name and version, etc.)

MacOs Sonoma

@redvex redvex added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 12, 2023
@github-actions github-actions bot added the @aws-cdk/aws-apigateway Related to Amazon API Gateway label Oct 12, 2023
@pahud
Copy link
Contributor

pahud commented Oct 13, 2023

This makes sense to allow custom response.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Oct 13, 2023
@mergify mergify bot closed this as completed in #27645 Oct 26, 2023
mergify bot pushed a commit that referenced this issue Oct 26, 2023
…tionsIntegrations (#27645)

In `StepFunctionsIntegration`, method response models (`methodResponses`) with 200, 400 and 500 status codes are added by default.

This PR adds `useDefaultMethodResponses` property not to add default method response models by set it to `false`.

Closes #27520.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

mrgrain pushed a commit that referenced this issue Nov 1, 2023
…tionsIntegrations (#27645)

In `StepFunctionsIntegration`, method response models (`methodResponses`) with 200, 400 and 500 status codes are added by default.

This PR adds `useDefaultMethodResponses` property not to add default method response models by set it to `false`.

Closes #27520.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-apigateway Related to Amazon API Gateway effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
2 participants