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

feat(apigatewayv2): add missing WebSocketIntegration props #29566

Merged
merged 9 commits into from
Mar 22, 2024

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"ApiId": {
"Ref": "mywsapi32E6CE11"
},
"ContentHandlingStrategy": "CONVERT_TO_BINARY",
"CredentialsArn": {
"Fn::GetAtt": [
"ApiGatewayRoleD2518903",
Expand All @@ -117,6 +118,10 @@
]
]
},
"PassthroughBehavior": "WHEN_NO_TEMPLATES",
"RequestParameters": {
"integration.request.header.Content-Type": "'application/x-www-form-urlencoded'"
},
"RequestTemplates": {
"application/json": {
"Fn::Join": [
Expand All @@ -130,7 +135,9 @@
]
]
}
}
},
"TemplateSelectionExpression": "\\$default",
"TimeoutInMillis": 10000
}
},
"mywsapiconnectRoute45A0ED6A": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HttpMethod, WebSocketApi, WebSocketStage } from 'aws-cdk-lib/aws-apigatewayv2';
import { ContentHandling, HttpMethod, PassthroughBehavior, WebSocketApi, WebSocketStage } from 'aws-cdk-lib/aws-apigatewayv2';
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
import * as iam from 'aws-cdk-lib/aws-iam';
import { App, RemovalPolicy, Stack } from 'aws-cdk-lib';
import { App, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';
import { WebSocketAwsIntegration, WebSocketMockIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';

Expand Down Expand Up @@ -42,6 +42,9 @@ webSocketApi.addRoute('$connect', {
integrationUri: `arn:aws:apigateway:${stack.region}:dynamodb:action/PutItem`,
integrationMethod: HttpMethod.POST,
credentialsRole: apiRole,
requestParameters: {
'integration.request.header.Content-Type': '\'application/x-www-form-urlencoded\'',
},
requestTemplates: {
'application/json': JSON.stringify({
TableName: table.tableName,
Expand All @@ -52,6 +55,10 @@ webSocketApi.addRoute('$connect', {
},
}),
},
templateSelectionExpression: '\\$default',
passthroughBehavior: PassthroughBehavior.WHEN_NO_TEMPLATES,
contentHandling: ContentHandling.CONVERT_TO_BINARY,
timeout: Duration.seconds(10),
}),
});

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@
"ApiId": {
"Ref": "mywsapi32E6CE11"
},
"ContentHandlingStrategy": "CONVERT_TO_TEXT",
"IntegrationType": "AWS_PROXY",
"IntegrationUri": {
"Fn::Join": [
Expand All @@ -454,7 +455,8 @@
"/invocations"
]
]
}
},
"TimeoutInMillis": 10000
}
},
"mywsapidefaultRouteE9382DF8": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading