-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(apigatewayv2): WebSocketAwsIntegration ignores requestParameters …
…and integrationPassThrough behaviors (#28921) #28718 missed adding requestParameters to the WebSocketAwsIntegration. Also added integrationPassThrough behaviors.
- Loading branch information
1 parent
812d7af
commit c459d72
Showing
11 changed files
with
920 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...napshot/apigatewayv2awsintegrationsqsintegtestDefaultTestDeployAssert51A62E2E.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...pshot/apigatewayv2awsintegrationsqsintegtestDefaultTestDeployAssert51A62E2E.template.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...ork-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.sqs.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...ions/test/websocket/integ.sqs.js.snapshot/integ-aws-websocket-sqs-integration.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
176 changes: 176 additions & 0 deletions
176
...ns/test/websocket/integ.sqs.js.snapshot/integ-aws-websocket-sqs-integration.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
{ | ||
"Resources": { | ||
"MessageSQSQueueF7E656B7": { | ||
"Type": "AWS::SQS::Queue", | ||
"Properties": { | ||
"FifoQueue": true, | ||
"QueueName": "MessageSQSQueue.fifo" | ||
}, | ||
"UpdateReplacePolicy": "Delete", | ||
"DeletionPolicy": "Delete" | ||
}, | ||
"webSocketApi5AB89700": { | ||
"Type": "AWS::ApiGatewayV2::Api", | ||
"Properties": { | ||
"Description": "Send websocket data to SQS which is then processed by a Lambda 2", | ||
"Name": "webSocketApi", | ||
"ProtocolType": "WEBSOCKET", | ||
"RouteSelectionExpression": "$request.body.action" | ||
} | ||
}, | ||
"webSocketApidefaultRouteSQSSendMessageFC4F9133": { | ||
"Type": "AWS::ApiGatewayV2::Integration", | ||
"Properties": { | ||
"ApiId": { | ||
"Ref": "webSocketApi5AB89700" | ||
}, | ||
"CredentialsArn": { | ||
"Fn::GetAtt": [ | ||
"webSocketApiRoleE85311F3", | ||
"Arn" | ||
] | ||
}, | ||
"IntegrationMethod": "POST", | ||
"IntegrationType": "AWS", | ||
"IntegrationUri": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:aws:apigateway:", | ||
{ | ||
"Ref": "AWS::Region" | ||
}, | ||
":sqs:path/", | ||
{ | ||
"Ref": "AWS::AccountId" | ||
}, | ||
"/", | ||
{ | ||
"Fn::GetAtt": [ | ||
"MessageSQSQueueF7E656B7", | ||
"QueueName" | ||
] | ||
} | ||
] | ||
] | ||
}, | ||
"PassthroughBehavior": "NEVER", | ||
"RequestParameters": { | ||
"integration.request.header.Content-Type": "'application/x-www-form-urlencoded'" | ||
}, | ||
"RequestTemplates": { | ||
"$default": "Action=SendMessage&MessageGroupId=$input.path('$.MessageGroupId')&MessageDeduplicationId=$context.requestId&MessageAttribute.1.Name=connectionId&MessageAttribute.1.Value.StringValue=$context.connectionId&MessageAttribute.1.Value.DataType=String&MessageAttribute.2.Name=requestId&MessageAttribute.2.Value.StringValue=$context.requestId&MessageAttribute.2.Value.DataType=String&MessageBody=$input.json('$')" | ||
}, | ||
"TemplateSelectionExpression": "\\$default" | ||
} | ||
}, | ||
"webSocketApidefaultRoute749519EC": { | ||
"Type": "AWS::ApiGatewayV2::Route", | ||
"Properties": { | ||
"ApiId": { | ||
"Ref": "webSocketApi5AB89700" | ||
}, | ||
"AuthorizationType": "NONE", | ||
"RouteKey": "$default", | ||
"Target": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"integrations/", | ||
{ | ||
"Ref": "webSocketApidefaultRouteSQSSendMessageFC4F9133" | ||
} | ||
] | ||
] | ||
} | ||
} | ||
}, | ||
"DevStage520A913F": { | ||
"Type": "AWS::ApiGatewayV2::Stage", | ||
"Properties": { | ||
"ApiId": { | ||
"Ref": "webSocketApi5AB89700" | ||
}, | ||
"AutoDeploy": true, | ||
"StageName": "dev" | ||
} | ||
}, | ||
"webSocketApiRoleE85311F3": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "apigateway.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
} | ||
}, | ||
"webSocketApiRoleDefaultPolicyF067C420": { | ||
"Type": "AWS::IAM::Policy", | ||
"Properties": { | ||
"PolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sqs:SendMessage", | ||
"Effect": "Allow", | ||
"Resource": { | ||
"Fn::GetAtt": [ | ||
"MessageSQSQueueF7E656B7", | ||
"Arn" | ||
] | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"PolicyName": "webSocketApiRoleDefaultPolicyF067C420", | ||
"Roles": [ | ||
{ | ||
"Ref": "webSocketApiRoleE85311F3" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.sqs.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.