-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat(apigateway): WebSocketIntegrationResponse
implementation
#29661
base: main
Are you sure you want to change the base?
feat(apigateway): WebSocketIntegrationResponse
implementation
#29661
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
// FIXME change to a warning? | ||
throw new Error('Setting up integration responses without setting up returnResponse to true will have no effect, and is likely a mistake.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | ||
* Integration response ID | ||
*/ | ||
public readonly integrationResponseId?: string; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this was added in anticipation of an implementation of integration responses, but serves no purpose and cannot store multiple responses
// FIXME any better way to generate a unique id? | ||
Names.nodeUniqueId(this.integration.node) + slugify(responseProps.responseKey.key) + 'IntegrationResponse', | ||
{ ...responseProps, integration: this.integration }, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure this is the best way to generate this ID, feedback would be appreciated
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
…ebsocket-integration-response
…ebsocket-integration-response
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue # (if applicable)
None as far as I could tell, related to #29562.
Reason for this change
While it is possible to use the L1
CfnIntegrationResponse
construct, it's not trivial given theWebSocketRouteIntegration
are currently bound to theWebSocketIntegration
on the fly.Description of changes
WebSocketIntegrationResponse
constructWebSocketIntegration
s (capable of settingIntegrationResponse
) aresponses
config prop, as well as aaddResponse
method. This allows me to check that there are no repeatresponseKey
s, and thatreturnResponse
is active if there areresponses
setCustomResponseWebSocketRoute
abstract class was created to isolateWebSocketLambdaIntegration
, which does not support response customizationWebSocketIntegrationResponseKey
helper class to access common and to generate customresponseKey
sAlso, and this was not the intent of this PR, but I found some missing properties for
WebSocketMockIntegration
while updating its integ test:requestTemplates
andtemplateSelectionExpression
to the newly createdWebSocketMockIntegrationProps
Description of how you validated changes
Unit tests were added/modified, and existing integration files were extended to include responses
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license