Skip to content

Commit 990ead3

Browse files
fix(apigatewayv2): WebSocketAwsIntegration ignores requestParameters and integrationPassThrough behaviors (#28921)
#28718 missed adding requestParameters to the WebSocketAwsIntegration. Also added integrationPassThrough behaviors.
1 parent 534794c commit 990ead3

File tree

11 files changed

+920
-0
lines changed

11 files changed

+920
-0
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.sqs.js.snapshot/apigatewayv2awsintegrationsqsintegtestDefaultTestDeployAssert51A62E2E.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.sqs.js.snapshot/apigatewayv2awsintegrationsqsintegtestDefaultTestDeployAssert51A62E2E.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.sqs.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.sqs.js.snapshot/integ-aws-websocket-sqs-integration.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
{
2+
"Resources": {
3+
"MessageSQSQueueF7E656B7": {
4+
"Type": "AWS::SQS::Queue",
5+
"Properties": {
6+
"FifoQueue": true,
7+
"QueueName": "MessageSQSQueue.fifo"
8+
},
9+
"UpdateReplacePolicy": "Delete",
10+
"DeletionPolicy": "Delete"
11+
},
12+
"webSocketApi5AB89700": {
13+
"Type": "AWS::ApiGatewayV2::Api",
14+
"Properties": {
15+
"Description": "Send websocket data to SQS which is then processed by a Lambda 2",
16+
"Name": "webSocketApi",
17+
"ProtocolType": "WEBSOCKET",
18+
"RouteSelectionExpression": "$request.body.action"
19+
}
20+
},
21+
"webSocketApidefaultRouteSQSSendMessageFC4F9133": {
22+
"Type": "AWS::ApiGatewayV2::Integration",
23+
"Properties": {
24+
"ApiId": {
25+
"Ref": "webSocketApi5AB89700"
26+
},
27+
"CredentialsArn": {
28+
"Fn::GetAtt": [
29+
"webSocketApiRoleE85311F3",
30+
"Arn"
31+
]
32+
},
33+
"IntegrationMethod": "POST",
34+
"IntegrationType": "AWS",
35+
"IntegrationUri": {
36+
"Fn::Join": [
37+
"",
38+
[
39+
"arn:aws:apigateway:",
40+
{
41+
"Ref": "AWS::Region"
42+
},
43+
":sqs:path/",
44+
{
45+
"Ref": "AWS::AccountId"
46+
},
47+
"/",
48+
{
49+
"Fn::GetAtt": [
50+
"MessageSQSQueueF7E656B7",
51+
"QueueName"
52+
]
53+
}
54+
]
55+
]
56+
},
57+
"PassthroughBehavior": "NEVER",
58+
"RequestParameters": {
59+
"integration.request.header.Content-Type": "'application/x-www-form-urlencoded'"
60+
},
61+
"RequestTemplates": {
62+
"$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('$')"
63+
},
64+
"TemplateSelectionExpression": "\\$default"
65+
}
66+
},
67+
"webSocketApidefaultRoute749519EC": {
68+
"Type": "AWS::ApiGatewayV2::Route",
69+
"Properties": {
70+
"ApiId": {
71+
"Ref": "webSocketApi5AB89700"
72+
},
73+
"AuthorizationType": "NONE",
74+
"RouteKey": "$default",
75+
"Target": {
76+
"Fn::Join": [
77+
"",
78+
[
79+
"integrations/",
80+
{
81+
"Ref": "webSocketApidefaultRouteSQSSendMessageFC4F9133"
82+
}
83+
]
84+
]
85+
}
86+
}
87+
},
88+
"DevStage520A913F": {
89+
"Type": "AWS::ApiGatewayV2::Stage",
90+
"Properties": {
91+
"ApiId": {
92+
"Ref": "webSocketApi5AB89700"
93+
},
94+
"AutoDeploy": true,
95+
"StageName": "dev"
96+
}
97+
},
98+
"webSocketApiRoleE85311F3": {
99+
"Type": "AWS::IAM::Role",
100+
"Properties": {
101+
"AssumeRolePolicyDocument": {
102+
"Statement": [
103+
{
104+
"Action": "sts:AssumeRole",
105+
"Effect": "Allow",
106+
"Principal": {
107+
"Service": "apigateway.amazonaws.com"
108+
}
109+
}
110+
],
111+
"Version": "2012-10-17"
112+
}
113+
}
114+
},
115+
"webSocketApiRoleDefaultPolicyF067C420": {
116+
"Type": "AWS::IAM::Policy",
117+
"Properties": {
118+
"PolicyDocument": {
119+
"Statement": [
120+
{
121+
"Action": "sqs:SendMessage",
122+
"Effect": "Allow",
123+
"Resource": {
124+
"Fn::GetAtt": [
125+
"MessageSQSQueueF7E656B7",
126+
"Arn"
127+
]
128+
}
129+
}
130+
],
131+
"Version": "2012-10-17"
132+
},
133+
"PolicyName": "webSocketApiRoleDefaultPolicyF067C420",
134+
"Roles": [
135+
{
136+
"Ref": "webSocketApiRoleE85311F3"
137+
}
138+
]
139+
}
140+
}
141+
},
142+
"Parameters": {
143+
"BootstrapVersion": {
144+
"Type": "AWS::SSM::Parameter::Value<String>",
145+
"Default": "/cdk-bootstrap/hnb659fds/version",
146+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
147+
}
148+
},
149+
"Rules": {
150+
"CheckBootstrapVersion": {
151+
"Assertions": [
152+
{
153+
"Assert": {
154+
"Fn::Not": [
155+
{
156+
"Fn::Contains": [
157+
[
158+
"1",
159+
"2",
160+
"3",
161+
"4",
162+
"5"
163+
],
164+
{
165+
"Ref": "BootstrapVersion"
166+
}
167+
]
168+
}
169+
]
170+
},
171+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
172+
}
173+
]
174+
}
175+
}
176+
}

packages/@aws-cdk-testing/framework-integ/test/aws-apigatewayv2-integrations/test/websocket/integ.sqs.js.snapshot/integ.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)