From 89f4f86b27536d5fc891cadb88d679abb9b93b2e Mon Sep 17 00:00:00 2001
From: Sumu Pitchayan <35242245+sumupitchayan@users.noreply.github.com>
Date: Wed, 1 Nov 2023 12:15:28 -0400
Subject: [PATCH] fix(apigatewayv2): trigger on websocket connect and
disconnect is not working (#27732)
Closes #19532
Lambda integrations for `$connect` and `$disconnect` routes were previously broken. Users would see this error message in the Lambda console:
![160185676-15ba5704-a7ba-49ef-b457-bb3f89094de6](https://github.com/aws/aws-cdk/assets/35242245/0938239a-b4f1-440d-9868-86ce3d213386)
Fixing the path by removing the extra `*/` from the [code of the Lambda integration](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-apigatewayv2-integrations-alpha/lib/websocket/lambda.ts#L36) that adds permission, we no longer see that error message in the Lambda console as the path is now correct:
I could not manage to figure out how to verify this change via an Integration test assertion. However, I added a new integration test file for Lambda `$connect` and `$disconnect` integrations on a `WebSocketApi`. The attached screenshots above also verify that this change works when I manually run it locally.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
---
.../http/integ.lambda.js.snapshot/tree.json | 20 +-
.../integ.user-pool.js.snapshot/tree.json | 168 ++--
.../IntegApiGatewayV2Iam.assets.json | 4 +-
.../IntegApiGatewayV2Iam.template.json | 2 +-
.../integ.iam.js.snapshot/manifest.json | 9 +-
.../websocket/integ.iam.js.snapshot/tree.json | 2 +-
.../lib/websocket/lambda.ts | 2 +-
...efaultTestDeployAssert4E6713E1.assets.json | 19 +
...aultTestDeployAssert4E6713E1.template.json | 36 +
.../package.json | 11 +
.../package.json | 11 +
.../cdk.out | 1 +
...wv2-lambda-connect-integration.assets.json | 45 +
...2-lambda-connect-integration.template.json | 470 ++++++++++
.../integ.json | 12 +
.../manifest.json | 211 +++++
.../tree.json | 849 ++++++++++++++++++
...integ.lambda-connect-disconnect-trigger.ts | 81 ++
.../WebSocketApiInteg.assets.json | 4 +-
.../WebSocketApiInteg.template.json | 8 +-
.../integ.lambda.js.snapshot/manifest.json | 23 +-
.../integ.lambda.js.snapshot/tree.json | 8 +-
.../websocket/lambdas/connect/package.json | 11 +
.../websocket/lambdas/disconnect/package.json | 11 +
.../aws-cdk-scheduler-schedule.assets.json | 6 +-
.../test/integ.schedule.js.snapshot/cdk.out | 2 +-
.../integ.schedule.js.snapshot/integ.json | 2 +-
...efaultTestDeployAssert24CB3896.assets.json | 2 +-
.../integ.schedule.js.snapshot/manifest.json | 4 +-
.../test/integ.schedule.js.snapshot/tree.json | 5 +
30 files changed, 1915 insertions(+), 124 deletions(-)
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.assets.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/asset.2748a200bf25c8ee2c2898271226a9f7bdc386b8ce9669528731eb36c5ed9e28/package.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/asset.e593848af17fee558eece2cd2719347804c0c141cff4f8ea1fb8556cf986b5a0/package.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/cdk.out
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ-apigwv2-lambda-connect-integration.assets.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ-apigwv2-lambda-connect-integration.template.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/manifest.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/tree.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.ts
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambdas/connect/package.json
create mode 100644 packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambdas/disconnect/package.json
diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.lambda.js.snapshot/tree.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.lambda.js.snapshot/tree.json
index 996df67fee0c0..08ec1606edb94 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.lambda.js.snapshot/tree.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.lambda.js.snapshot/tree.json
@@ -171,7 +171,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpStage",
"version": "0.0.0"
}
},
@@ -209,7 +209,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpIntegration",
"version": "0.0.0"
}
},
@@ -292,7 +292,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpRoute",
"version": "0.0.0"
}
},
@@ -349,7 +349,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpAuthorizer",
"version": "0.0.0"
}
},
@@ -403,7 +403,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpApi",
"version": "0.0.0"
}
},
@@ -450,7 +450,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpStage",
"version": "0.0.0"
}
},
@@ -507,7 +507,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpAuthorizer",
"version": "0.0.0"
}
},
@@ -561,7 +561,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpApi",
"version": "0.0.0"
}
},
@@ -719,7 +719,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpIntegration",
"version": "0.0.0"
}
},
@@ -802,7 +802,7 @@
}
},
"constructInfo": {
- "fqn": "aws-cdk-lib.Resource",
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpRoute",
"version": "0.0.0"
}
},
diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.user-pool.js.snapshot/tree.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.user-pool.js.snapshot/tree.json
index 7dd213178bc9c..23f942bfe3fdc 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.user-pool.js.snapshot/tree.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.user-pool.js.snapshot/tree.json
@@ -45,8 +45,8 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_cognito.CfnUserPool",
+ "version": "0.0.0"
}
},
"UserPoolAuthorizerClient": {
@@ -83,20 +83,20 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_cognito.CfnUserPoolClient",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_cognito.UserPoolClient",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_cognito.UserPool",
+ "version": "0.0.0"
}
},
"userpoolForDefaultAuthorizer": {
@@ -136,8 +136,8 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_cognito.CfnUserPool",
+ "version": "0.0.0"
}
},
"UserPoolAuthorizerClient": {
@@ -174,20 +174,20 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_cognito.CfnUserPoolClient",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_cognito.UserPoolClient",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_cognito.UserPool",
+ "version": "0.0.0"
}
},
"MyHttpApi": {
@@ -205,8 +205,8 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnApi",
+ "version": "0.0.0"
}
},
"DefaultStage": {
@@ -227,14 +227,14 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnStage",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpStage",
+ "version": "0.0.0"
}
},
"GET--": {
@@ -265,14 +265,14 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnIntegration",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpIntegration",
+ "version": "0.0.0"
}
},
"RootIntegratin-Permission": {
@@ -316,8 +316,8 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_lambda.CfnPermission",
+ "version": "0.0.0"
}
},
"Resource": {
@@ -348,14 +348,14 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnRoute",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpRoute",
+ "version": "0.0.0"
}
},
"UserPoolAuthorizer": {
@@ -401,20 +401,20 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnAuthorizer",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpAuthorizer",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpApi",
+ "version": "0.0.0"
}
},
"MyHttpApiWithDefaultAuthorizer": {
@@ -432,8 +432,8 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnApi",
+ "version": "0.0.0"
}
},
"DefaultStage": {
@@ -454,14 +454,14 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnStage",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpStage",
+ "version": "0.0.0"
}
},
"UserPoolDefaultAuthorizer": {
@@ -507,20 +507,20 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnAuthorizer",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpAuthorizer",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpApi",
+ "version": "0.0.0"
}
},
"lambda": {
@@ -535,8 +535,8 @@
"id": "ImportServiceRole",
"path": "AuthorizerInteg/lambda/ServiceRole/ImportServiceRole",
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.Resource",
+ "version": "0.0.0"
}
},
"Resource": {
@@ -574,14 +574,14 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_iam.CfnRole",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_iam.Role",
+ "version": "0.0.0"
}
},
"Code": {
@@ -592,22 +592,22 @@
"id": "Stage",
"path": "AuthorizerInteg/lambda/Code/Stage",
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.AssetStaging",
+ "version": "0.0.0"
}
},
"AssetBucket": {
"id": "AssetBucket",
"path": "AuthorizerInteg/lambda/Code/AssetBucket",
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_s3.BucketBase",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_s3_assets.Asset",
+ "version": "0.0.0"
}
},
"Resource": {
@@ -633,14 +633,14 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_lambda.CfnFunction",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_lambda.Function",
+ "version": "0.0.0"
}
},
"Route": {
@@ -671,14 +671,14 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnIntegration",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpIntegration",
+ "version": "0.0.0"
}
},
"RootIntegration-Permission": {
@@ -722,8 +722,8 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_lambda.CfnPermission",
+ "version": "0.0.0"
}
},
"Resource": {
@@ -758,36 +758,36 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnRoute",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpRoute",
+ "version": "0.0.0"
}
},
"BootstrapVersion": {
"id": "BootstrapVersion",
"path": "AuthorizerInteg/BootstrapVersion",
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.CfnParameter",
+ "version": "0.0.0"
}
},
"CheckBootstrapVersion": {
"id": "CheckBootstrapVersion",
"path": "AuthorizerInteg/CheckBootstrapVersion",
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.CfnRule",
+ "version": "0.0.0"
}
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.Stack",
+ "version": "0.0.0"
}
},
"Tree": {
@@ -800,8 +800,8 @@
}
},
"constructInfo": {
- "fqn": "constructs.Construct",
- "version": "10.2.70"
+ "fqn": "aws-cdk-lib.App",
+ "version": "0.0.0"
}
}
}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/IntegApiGatewayV2Iam.assets.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/IntegApiGatewayV2Iam.assets.json
index acfbbfa7a6875..4ab5619801629 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/IntegApiGatewayV2Iam.assets.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/IntegApiGatewayV2Iam.assets.json
@@ -1,7 +1,7 @@
{
"version": "34.0.0",
"files": {
- "89f3eb281075e38df0df45fd2cf30f90cd7bbaabddef614ebee1040631c2a0c6": {
+ "0fecdddcc93cb59f37820c43eaa8030e35f0be824e2f8e7b63bde0bb0b24e264": {
"source": {
"path": "IntegApiGatewayV2Iam.template.json",
"packaging": "file"
@@ -9,7 +9,7 @@
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
- "objectKey": "89f3eb281075e38df0df45fd2cf30f90cd7bbaabddef614ebee1040631c2a0c6.json",
+ "objectKey": "0fecdddcc93cb59f37820c43eaa8030e35f0be824e2f8e7b63bde0bb0b24e264.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/IntegApiGatewayV2Iam.template.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/IntegApiGatewayV2Iam.template.json
index ec0283f3bd2bd..5e3e47d97b6cf 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/IntegApiGatewayV2Iam.template.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/IntegApiGatewayV2Iam.template.json
@@ -100,7 +100,7 @@
{
"Ref": "WebSocketApi34BCF99B"
},
- "/*/*$connect"
+ "/*$connect"
]
]
}
diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/manifest.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/manifest.json
index 529e868fc518c..5cd819d527b7b 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/manifest.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/manifest.json
@@ -14,10 +14,11 @@
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "IntegApiGatewayV2Iam.template.json",
+ "terminationProtection": false,
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
- "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/89f3eb281075e38df0df45fd2cf30f90cd7bbaabddef614ebee1040631c2a0c6.json",
+ "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0fecdddcc93cb59f37820c43eaa8030e35f0be824e2f8e7b63bde0bb0b24e264.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
@@ -66,7 +67,10 @@
"/IntegApiGatewayV2Iam/WebSocketApi/$connect-Route/WebSocketLambdaIntegration-Permission": [
{
"type": "aws:cdk:logicalId",
- "data": "WebSocketApiconnectRouteWebSocketLambdaIntegrationPermission76CD86C6"
+ "data": "WebSocketApiconnectRouteWebSocketLambdaIntegrationPermission76CD86C6",
+ "trace": [
+ "!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
+ ]
}
],
"/IntegApiGatewayV2Iam/WebSocketApi/$connect-Route/WebSocketLambdaIntegration/Resource": [
@@ -133,6 +137,7 @@
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "ApiGatewayV2WebSocketIamTestDefaultTestDeployAssert2B412D7B.template.json",
+ "terminationProtection": false,
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/tree.json b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/tree.json
index 3aeaca1832db8..2192187ed14af 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/tree.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.js.snapshot/tree.json
@@ -205,7 +205,7 @@
{
"Ref": "WebSocketApi34BCF99B"
},
- "/*/*$connect"
+ "/*$connect"
]
]
}
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/lib/websocket/lambda.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/lib/websocket/lambda.ts
index 9306ef7dc0e7a..e57068e90e1b3 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/lib/websocket/lambda.ts
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/lib/websocket/lambda.ts
@@ -33,7 +33,7 @@ export class WebSocketLambdaIntegration extends WebSocketRouteIntegration {
sourceArn: Stack.of(route).formatArn({
service: 'execute-api',
resource: route.webSocketApi.apiId,
- resourceName: `*/*${route.routeKey}`,
+ resourceName: `*${route.routeKey}`,
}),
});
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.assets.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.assets.json
new file mode 100644
index 0000000000000..618513371ae9f
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.assets.json
@@ -0,0 +1,19 @@
+{
+ "version": "34.0.0",
+ "files": {
+ "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
+ "source": {
+ "path": "IntegDefaultTestDeployAssert4E6713E1.template.json",
+ "packaging": "file"
+ },
+ "destinations": {
+ "current_account-current_region": {
+ "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
+ "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
+ "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
+ }
+ }
+ }
+ },
+ "dockerImages": {}
+}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json
new file mode 100644
index 0000000000000..ad9d0fb73d1dd
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json
@@ -0,0 +1,36 @@
+{
+ "Parameters": {
+ "BootstrapVersion": {
+ "Type": "AWS::SSM::Parameter::Value",
+ "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."
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/asset.2748a200bf25c8ee2c2898271226a9f7bdc386b8ce9669528731eb36c5ed9e28/package.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/asset.2748a200bf25c8ee2c2898271226a9f7bdc386b8ce9669528731eb36c5ed9e28/package.json
new file mode 100644
index 0000000000000..941efba0e8117
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/asset.2748a200bf25c8ee2c2898271226a9f7bdc386b8ce9669528731eb36c5ed9e28/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "connect",
+ "version": "1.0.0",
+ "description": "connect example for WebSockets on API Gateway",
+ "main": "index.js",
+ "author": "SAM CLI",
+ "license": "MIT",
+ "dependencies": {
+ "aws-sdk": "^2.690.0"
+ }
+}
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/asset.e593848af17fee558eece2cd2719347804c0c141cff4f8ea1fb8556cf986b5a0/package.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/asset.e593848af17fee558eece2cd2719347804c0c141cff4f8ea1fb8556cf986b5a0/package.json
new file mode 100644
index 0000000000000..f7f07857f72ea
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/asset.e593848af17fee558eece2cd2719347804c0c141cff4f8ea1fb8556cf986b5a0/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "disconnect",
+ "version": "1.0.0",
+ "description": "disconnect example for WebSockets on API Gateway",
+ "main": "index.js",
+ "author": "SAM CLI",
+ "license": "MIT",
+ "dependencies": {
+ "aws-sdk": "^2.690.0"
+ }
+}
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/cdk.out b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/cdk.out
new file mode 100644
index 0000000000000..2313ab5436501
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/cdk.out
@@ -0,0 +1 @@
+{"version":"34.0.0"}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ-apigwv2-lambda-connect-integration.assets.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ-apigwv2-lambda-connect-integration.assets.json
new file mode 100644
index 0000000000000..b2efe2d122ad2
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ-apigwv2-lambda-connect-integration.assets.json
@@ -0,0 +1,45 @@
+{
+ "version": "34.0.0",
+ "files": {
+ "2748a200bf25c8ee2c2898271226a9f7bdc386b8ce9669528731eb36c5ed9e28": {
+ "source": {
+ "path": "asset.2748a200bf25c8ee2c2898271226a9f7bdc386b8ce9669528731eb36c5ed9e28",
+ "packaging": "zip"
+ },
+ "destinations": {
+ "current_account-current_region": {
+ "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
+ "objectKey": "2748a200bf25c8ee2c2898271226a9f7bdc386b8ce9669528731eb36c5ed9e28.zip",
+ "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
+ }
+ }
+ },
+ "e593848af17fee558eece2cd2719347804c0c141cff4f8ea1fb8556cf986b5a0": {
+ "source": {
+ "path": "asset.e593848af17fee558eece2cd2719347804c0c141cff4f8ea1fb8556cf986b5a0",
+ "packaging": "zip"
+ },
+ "destinations": {
+ "current_account-current_region": {
+ "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
+ "objectKey": "e593848af17fee558eece2cd2719347804c0c141cff4f8ea1fb8556cf986b5a0.zip",
+ "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
+ }
+ }
+ },
+ "8d51b7c174041dae18b57745e88660ee14de05b2ac0e42fb860dca1ff5677b71": {
+ "source": {
+ "path": "integ-apigwv2-lambda-connect-integration.template.json",
+ "packaging": "file"
+ },
+ "destinations": {
+ "current_account-current_region": {
+ "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
+ "objectKey": "8d51b7c174041dae18b57745e88660ee14de05b2ac0e42fb860dca1ff5677b71.json",
+ "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
+ }
+ }
+ }
+ },
+ "dockerImages": {}
+}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ-apigwv2-lambda-connect-integration.template.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ-apigwv2-lambda-connect-integration.template.json
new file mode 100644
index 0000000000000..c61991e3b6d33
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ-apigwv2-lambda-connect-integration.template.json
@@ -0,0 +1,470 @@
+{
+ "Resources": {
+ "ConnectFunctionServiceRoleDD1EAA8C": {
+ "Type": "AWS::IAM::Role",
+ "Properties": {
+ "AssumeRolePolicyDocument": {
+ "Statement": [
+ {
+ "Action": "sts:AssumeRole",
+ "Effect": "Allow",
+ "Principal": {
+ "Service": "lambda.amazonaws.com"
+ }
+ }
+ ],
+ "Version": "2012-10-17"
+ },
+ "ManagedPolicyArns": [
+ {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
+ ]
+ ]
+ }
+ ]
+ }
+ },
+ "ConnectFunctionServiceRoleDefaultPolicy9C1FE0B3": {
+ "Type": "AWS::IAM::Policy",
+ "Properties": {
+ "PolicyDocument": {
+ "Statement": [
+ {
+ "Action": [
+ "dynamodb:BatchGetItem",
+ "dynamodb:BatchWriteItem",
+ "dynamodb:ConditionCheckItem",
+ "dynamodb:DeleteItem",
+ "dynamodb:DescribeTable",
+ "dynamodb:GetItem",
+ "dynamodb:GetRecords",
+ "dynamodb:GetShardIterator",
+ "dynamodb:PutItem",
+ "dynamodb:Query",
+ "dynamodb:Scan",
+ "dynamodb:UpdateItem"
+ ],
+ "Effect": "Allow",
+ "Resource": [
+ {
+ "Fn::GetAtt": [
+ "WebSocketLogTable7F74AAC5",
+ "Arn"
+ ]
+ },
+ {
+ "Ref": "AWS::NoValue"
+ }
+ ]
+ }
+ ],
+ "Version": "2012-10-17"
+ },
+ "PolicyName": "ConnectFunctionServiceRoleDefaultPolicy9C1FE0B3",
+ "Roles": [
+ {
+ "Ref": "ConnectFunctionServiceRoleDD1EAA8C"
+ }
+ ]
+ }
+ },
+ "ConnectFunction4D4B4BB5": {
+ "Type": "AWS::Lambda::Function",
+ "Properties": {
+ "Code": {
+ "S3Bucket": {
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
+ },
+ "S3Key": "2748a200bf25c8ee2c2898271226a9f7bdc386b8ce9669528731eb36c5ed9e28.zip"
+ },
+ "Environment": {
+ "Variables": {
+ "TABLE_NAME": "WebSocketConnections"
+ }
+ },
+ "FunctionName": "process_connect_requests",
+ "Handler": "index.handler",
+ "Role": {
+ "Fn::GetAtt": [
+ "ConnectFunctionServiceRoleDD1EAA8C",
+ "Arn"
+ ]
+ },
+ "Runtime": "nodejs14.x",
+ "Timeout": 5
+ },
+ "DependsOn": [
+ "ConnectFunctionServiceRoleDefaultPolicy9C1FE0B3",
+ "ConnectFunctionServiceRoleDD1EAA8C"
+ ]
+ },
+ "DisconnectFunctionServiceRole49DB60AC": {
+ "Type": "AWS::IAM::Role",
+ "Properties": {
+ "AssumeRolePolicyDocument": {
+ "Statement": [
+ {
+ "Action": "sts:AssumeRole",
+ "Effect": "Allow",
+ "Principal": {
+ "Service": "lambda.amazonaws.com"
+ }
+ }
+ ],
+ "Version": "2012-10-17"
+ },
+ "ManagedPolicyArns": [
+ {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
+ ]
+ ]
+ }
+ ]
+ }
+ },
+ "DisconnectFunctionServiceRoleDefaultPolicyF5348EC3": {
+ "Type": "AWS::IAM::Policy",
+ "Properties": {
+ "PolicyDocument": {
+ "Statement": [
+ {
+ "Action": [
+ "dynamodb:BatchGetItem",
+ "dynamodb:BatchWriteItem",
+ "dynamodb:ConditionCheckItem",
+ "dynamodb:DeleteItem",
+ "dynamodb:DescribeTable",
+ "dynamodb:GetItem",
+ "dynamodb:GetRecords",
+ "dynamodb:GetShardIterator",
+ "dynamodb:PutItem",
+ "dynamodb:Query",
+ "dynamodb:Scan",
+ "dynamodb:UpdateItem"
+ ],
+ "Effect": "Allow",
+ "Resource": [
+ {
+ "Fn::GetAtt": [
+ "WebSocketLogTable7F74AAC5",
+ "Arn"
+ ]
+ },
+ {
+ "Ref": "AWS::NoValue"
+ }
+ ]
+ }
+ ],
+ "Version": "2012-10-17"
+ },
+ "PolicyName": "DisconnectFunctionServiceRoleDefaultPolicyF5348EC3",
+ "Roles": [
+ {
+ "Ref": "DisconnectFunctionServiceRole49DB60AC"
+ }
+ ]
+ }
+ },
+ "DisconnectFunction620A9610": {
+ "Type": "AWS::Lambda::Function",
+ "Properties": {
+ "Code": {
+ "S3Bucket": {
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
+ },
+ "S3Key": "e593848af17fee558eece2cd2719347804c0c141cff4f8ea1fb8556cf986b5a0.zip"
+ },
+ "Environment": {
+ "Variables": {
+ "TABLE_NAME": "WebSocketConnections"
+ }
+ },
+ "FunctionName": "process_disconnect_requests",
+ "Handler": "index.handler",
+ "Role": {
+ "Fn::GetAtt": [
+ "DisconnectFunctionServiceRole49DB60AC",
+ "Arn"
+ ]
+ },
+ "Runtime": "nodejs14.x",
+ "Timeout": 5
+ },
+ "DependsOn": [
+ "DisconnectFunctionServiceRoleDefaultPolicyF5348EC3",
+ "DisconnectFunctionServiceRole49DB60AC"
+ ]
+ },
+ "WebSocketLogTable7F74AAC5": {
+ "Type": "AWS::DynamoDB::Table",
+ "Properties": {
+ "AttributeDefinitions": [
+ {
+ "AttributeName": "ConnectionId",
+ "AttributeType": "S"
+ }
+ ],
+ "KeySchema": [
+ {
+ "AttributeName": "ConnectionId",
+ "KeyType": "HASH"
+ }
+ ],
+ "ProvisionedThroughput": {
+ "ReadCapacityUnits": 5,
+ "WriteCapacityUnits": 5
+ },
+ "TableName": "WebSocketConnections"
+ },
+ "UpdateReplacePolicy": "Delete",
+ "DeletionPolicy": "Delete"
+ },
+ "WebSocketAPIDA75128A": {
+ "Type": "AWS::ApiGatewayV2::Api",
+ "Properties": {
+ "Name": "webSocket",
+ "ProtocolType": "WEBSOCKET",
+ "RouteSelectionExpression": "$request.body.action"
+ }
+ },
+ "WebSocketAPIconnectRouteConnectIntegrationPermission1FECDE58": {
+ "Type": "AWS::Lambda::Permission",
+ "Properties": {
+ "Action": "lambda:InvokeFunction",
+ "FunctionName": {
+ "Fn::GetAtt": [
+ "ConnectFunction4D4B4BB5",
+ "Arn"
+ ]
+ },
+ "Principal": "apigateway.amazonaws.com",
+ "SourceArn": {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":execute-api:",
+ {
+ "Ref": "AWS::Region"
+ },
+ ":",
+ {
+ "Ref": "AWS::AccountId"
+ },
+ ":",
+ {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "/*$connect"
+ ]
+ ]
+ }
+ }
+ },
+ "WebSocketAPIconnectRouteConnectIntegration2725692A": {
+ "Type": "AWS::ApiGatewayV2::Integration",
+ "Properties": {
+ "ApiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "IntegrationType": "AWS_PROXY",
+ "IntegrationUri": {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":apigateway:",
+ {
+ "Ref": "AWS::Region"
+ },
+ ":lambda:path/2015-03-31/functions/",
+ {
+ "Fn::GetAtt": [
+ "ConnectFunction4D4B4BB5",
+ "Arn"
+ ]
+ },
+ "/invocations"
+ ]
+ ]
+ }
+ }
+ },
+ "WebSocketAPIconnectRoute4BD84FCF": {
+ "Type": "AWS::ApiGatewayV2::Route",
+ "Properties": {
+ "ApiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "AuthorizationType": "NONE",
+ "RouteKey": "$connect",
+ "Target": {
+ "Fn::Join": [
+ "",
+ [
+ "integrations/",
+ {
+ "Ref": "WebSocketAPIconnectRouteConnectIntegration2725692A"
+ }
+ ]
+ ]
+ }
+ }
+ },
+ "WebSocketAPIdisconnectRouteDisconnectIntegrationPermission909CCDD8": {
+ "Type": "AWS::Lambda::Permission",
+ "Properties": {
+ "Action": "lambda:InvokeFunction",
+ "FunctionName": {
+ "Fn::GetAtt": [
+ "DisconnectFunction620A9610",
+ "Arn"
+ ]
+ },
+ "Principal": "apigateway.amazonaws.com",
+ "SourceArn": {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":execute-api:",
+ {
+ "Ref": "AWS::Region"
+ },
+ ":",
+ {
+ "Ref": "AWS::AccountId"
+ },
+ ":",
+ {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "/*$disconnect"
+ ]
+ ]
+ }
+ }
+ },
+ "WebSocketAPIdisconnectRouteDisconnectIntegration317B9227": {
+ "Type": "AWS::ApiGatewayV2::Integration",
+ "Properties": {
+ "ApiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "IntegrationType": "AWS_PROXY",
+ "IntegrationUri": {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":apigateway:",
+ {
+ "Ref": "AWS::Region"
+ },
+ ":lambda:path/2015-03-31/functions/",
+ {
+ "Fn::GetAtt": [
+ "DisconnectFunction620A9610",
+ "Arn"
+ ]
+ },
+ "/invocations"
+ ]
+ ]
+ }
+ }
+ },
+ "WebSocketAPIdisconnectRouteBC1A3C36": {
+ "Type": "AWS::ApiGatewayV2::Route",
+ "Properties": {
+ "ApiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "AuthorizationType": "NONE",
+ "RouteKey": "$disconnect",
+ "Target": {
+ "Fn::Join": [
+ "",
+ [
+ "integrations/",
+ {
+ "Ref": "WebSocketAPIdisconnectRouteDisconnectIntegration317B9227"
+ }
+ ]
+ ]
+ }
+ }
+ },
+ "ProductionStage7933AAB2": {
+ "Type": "AWS::ApiGatewayV2::Stage",
+ "Properties": {
+ "ApiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "AutoDeploy": true,
+ "StageName": "prod"
+ }
+ }
+ },
+ "Parameters": {
+ "BootstrapVersion": {
+ "Type": "AWS::SSM::Parameter::Value",
+ "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."
+ }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ.json
new file mode 100644
index 0000000000000..f122cfe8f44e1
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/integ.json
@@ -0,0 +1,12 @@
+{
+ "version": "34.0.0",
+ "testCases": {
+ "Integ/DefaultTest": {
+ "stacks": [
+ "integ-apigwv2-lambda-connect-integration"
+ ],
+ "assertionStack": "Integ/DefaultTest/DeployAssert",
+ "assertionStackName": "IntegDefaultTestDeployAssert4E6713E1"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/manifest.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/manifest.json
new file mode 100644
index 0000000000000..43f212b29e333
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/manifest.json
@@ -0,0 +1,211 @@
+{
+ "version": "34.0.0",
+ "artifacts": {
+ "integ-apigwv2-lambda-connect-integration.assets": {
+ "type": "cdk:asset-manifest",
+ "properties": {
+ "file": "integ-apigwv2-lambda-connect-integration.assets.json",
+ "requiresBootstrapStackVersion": 6,
+ "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
+ }
+ },
+ "integ-apigwv2-lambda-connect-integration": {
+ "type": "aws:cloudformation:stack",
+ "environment": "aws://unknown-account/unknown-region",
+ "properties": {
+ "templateFile": "integ-apigwv2-lambda-connect-integration.template.json",
+ "terminationProtection": false,
+ "validateOnSynth": false,
+ "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
+ "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
+ "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/8d51b7c174041dae18b57745e88660ee14de05b2ac0e42fb860dca1ff5677b71.json",
+ "requiresBootstrapStackVersion": 6,
+ "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
+ "additionalDependencies": [
+ "integ-apigwv2-lambda-connect-integration.assets"
+ ],
+ "lookupRole": {
+ "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
+ "requiresBootstrapStackVersion": 8,
+ "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
+ }
+ },
+ "dependencies": [
+ "integ-apigwv2-lambda-connect-integration.assets"
+ ],
+ "metadata": {
+ "/integ-apigwv2-lambda-connect-integration/Connect Function/ServiceRole/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "ConnectFunctionServiceRoleDD1EAA8C"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/Connect Function/ServiceRole/DefaultPolicy/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "ConnectFunctionServiceRoleDefaultPolicy9C1FE0B3"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/Connect Function/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "ConnectFunction4D4B4BB5"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/Disconnect Function/ServiceRole/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "DisconnectFunctionServiceRole49DB60AC"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/Disconnect Function/ServiceRole/DefaultPolicy/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "DisconnectFunctionServiceRoleDefaultPolicyF5348EC3"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/Disconnect Function/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "DisconnectFunction620A9610"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/WebSocket Log Table": [
+ {
+ "type": "aws:cdk:hasPhysicalName",
+ "data": {
+ "Ref": "WebSocketLogTable7F74AAC5"
+ }
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/WebSocket Log Table/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "WebSocketLogTable7F74AAC5"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/WebSocket API/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "WebSocketAPIDA75128A"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/WebSocket API/$connect-Route/ConnectIntegration-Permission": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "WebSocketAPIconnectRouteConnectIntegrationPermission1FECDE58",
+ "trace": [
+ "!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
+ ]
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/WebSocket API/$connect-Route/ConnectIntegration/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "WebSocketAPIconnectRouteConnectIntegration2725692A"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/WebSocket API/$connect-Route/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "WebSocketAPIconnectRoute4BD84FCF"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/WebSocket API/$disconnect-Route/DisconnectIntegration-Permission": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "WebSocketAPIdisconnectRouteDisconnectIntegrationPermission909CCDD8",
+ "trace": [
+ "!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
+ ]
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/WebSocket API/$disconnect-Route/DisconnectIntegration/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "WebSocketAPIdisconnectRouteDisconnectIntegration317B9227"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/WebSocket API/$disconnect-Route/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "WebSocketAPIdisconnectRouteBC1A3C36"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/Production Stage/Resource": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "ProductionStage7933AAB2"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/BootstrapVersion": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "BootstrapVersion"
+ }
+ ],
+ "/integ-apigwv2-lambda-connect-integration/CheckBootstrapVersion": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "CheckBootstrapVersion"
+ }
+ ]
+ },
+ "displayName": "integ-apigwv2-lambda-connect-integration"
+ },
+ "IntegDefaultTestDeployAssert4E6713E1.assets": {
+ "type": "cdk:asset-manifest",
+ "properties": {
+ "file": "IntegDefaultTestDeployAssert4E6713E1.assets.json",
+ "requiresBootstrapStackVersion": 6,
+ "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
+ }
+ },
+ "IntegDefaultTestDeployAssert4E6713E1": {
+ "type": "aws:cloudformation:stack",
+ "environment": "aws://unknown-account/unknown-region",
+ "properties": {
+ "templateFile": "IntegDefaultTestDeployAssert4E6713E1.template.json",
+ "terminationProtection": false,
+ "validateOnSynth": false,
+ "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
+ "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
+ "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
+ "requiresBootstrapStackVersion": 6,
+ "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
+ "additionalDependencies": [
+ "IntegDefaultTestDeployAssert4E6713E1.assets"
+ ],
+ "lookupRole": {
+ "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
+ "requiresBootstrapStackVersion": 8,
+ "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
+ }
+ },
+ "dependencies": [
+ "IntegDefaultTestDeployAssert4E6713E1.assets"
+ ],
+ "metadata": {
+ "/Integ/DefaultTest/DeployAssert/BootstrapVersion": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "BootstrapVersion"
+ }
+ ],
+ "/Integ/DefaultTest/DeployAssert/CheckBootstrapVersion": [
+ {
+ "type": "aws:cdk:logicalId",
+ "data": "CheckBootstrapVersion"
+ }
+ ]
+ },
+ "displayName": "Integ/DefaultTest/DeployAssert"
+ },
+ "Tree": {
+ "type": "cdk:tree",
+ "properties": {
+ "file": "tree.json"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/tree.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/tree.json
new file mode 100644
index 0000000000000..26157d6a3c755
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.js.snapshot/tree.json
@@ -0,0 +1,849 @@
+{
+ "version": "tree-0.1",
+ "tree": {
+ "id": "App",
+ "path": "",
+ "children": {
+ "integ-apigwv2-lambda-connect-integration": {
+ "id": "integ-apigwv2-lambda-connect-integration",
+ "path": "integ-apigwv2-lambda-connect-integration",
+ "children": {
+ "Connect Function": {
+ "id": "Connect Function",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function",
+ "children": {
+ "ServiceRole": {
+ "id": "ServiceRole",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function/ServiceRole",
+ "children": {
+ "ImportServiceRole": {
+ "id": "ImportServiceRole",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function/ServiceRole/ImportServiceRole",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.Resource",
+ "version": "0.0.0"
+ }
+ },
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function/ServiceRole/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::IAM::Role",
+ "aws:cdk:cloudformation:props": {
+ "assumeRolePolicyDocument": {
+ "Statement": [
+ {
+ "Action": "sts:AssumeRole",
+ "Effect": "Allow",
+ "Principal": {
+ "Service": "lambda.amazonaws.com"
+ }
+ }
+ ],
+ "Version": "2012-10-17"
+ },
+ "managedPolicyArns": [
+ {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
+ ]
+ ]
+ }
+ ]
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_iam.CfnRole",
+ "version": "0.0.0"
+ }
+ },
+ "DefaultPolicy": {
+ "id": "DefaultPolicy",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function/ServiceRole/DefaultPolicy",
+ "children": {
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function/ServiceRole/DefaultPolicy/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::IAM::Policy",
+ "aws:cdk:cloudformation:props": {
+ "policyDocument": {
+ "Statement": [
+ {
+ "Action": [
+ "dynamodb:BatchGetItem",
+ "dynamodb:BatchWriteItem",
+ "dynamodb:ConditionCheckItem",
+ "dynamodb:DeleteItem",
+ "dynamodb:DescribeTable",
+ "dynamodb:GetItem",
+ "dynamodb:GetRecords",
+ "dynamodb:GetShardIterator",
+ "dynamodb:PutItem",
+ "dynamodb:Query",
+ "dynamodb:Scan",
+ "dynamodb:UpdateItem"
+ ],
+ "Effect": "Allow",
+ "Resource": [
+ {
+ "Fn::GetAtt": [
+ "WebSocketLogTable7F74AAC5",
+ "Arn"
+ ]
+ },
+ {
+ "Ref": "AWS::NoValue"
+ }
+ ]
+ }
+ ],
+ "Version": "2012-10-17"
+ },
+ "policyName": "ConnectFunctionServiceRoleDefaultPolicy9C1FE0B3",
+ "roles": [
+ {
+ "Ref": "ConnectFunctionServiceRoleDD1EAA8C"
+ }
+ ]
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_iam.CfnPolicy",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_iam.Policy",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_iam.Role",
+ "version": "0.0.0"
+ }
+ },
+ "Code": {
+ "id": "Code",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function/Code",
+ "children": {
+ "Stage": {
+ "id": "Stage",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function/Code/Stage",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.AssetStaging",
+ "version": "0.0.0"
+ }
+ },
+ "AssetBucket": {
+ "id": "AssetBucket",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function/Code/AssetBucket",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_s3.BucketBase",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_s3_assets.Asset",
+ "version": "0.0.0"
+ }
+ },
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/Connect Function/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::Lambda::Function",
+ "aws:cdk:cloudformation:props": {
+ "code": {
+ "s3Bucket": {
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
+ },
+ "s3Key": "2748a200bf25c8ee2c2898271226a9f7bdc386b8ce9669528731eb36c5ed9e28.zip"
+ },
+ "environment": {
+ "variables": {
+ "TABLE_NAME": "WebSocketConnections"
+ }
+ },
+ "functionName": "process_connect_requests",
+ "handler": "index.handler",
+ "role": {
+ "Fn::GetAtt": [
+ "ConnectFunctionServiceRoleDD1EAA8C",
+ "Arn"
+ ]
+ },
+ "runtime": "nodejs14.x",
+ "timeout": 5
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_lambda.CfnFunction",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_lambda.Function",
+ "version": "0.0.0"
+ }
+ },
+ "Disconnect Function": {
+ "id": "Disconnect Function",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function",
+ "children": {
+ "ServiceRole": {
+ "id": "ServiceRole",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function/ServiceRole",
+ "children": {
+ "ImportServiceRole": {
+ "id": "ImportServiceRole",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function/ServiceRole/ImportServiceRole",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.Resource",
+ "version": "0.0.0"
+ }
+ },
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function/ServiceRole/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::IAM::Role",
+ "aws:cdk:cloudformation:props": {
+ "assumeRolePolicyDocument": {
+ "Statement": [
+ {
+ "Action": "sts:AssumeRole",
+ "Effect": "Allow",
+ "Principal": {
+ "Service": "lambda.amazonaws.com"
+ }
+ }
+ ],
+ "Version": "2012-10-17"
+ },
+ "managedPolicyArns": [
+ {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
+ ]
+ ]
+ }
+ ]
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_iam.CfnRole",
+ "version": "0.0.0"
+ }
+ },
+ "DefaultPolicy": {
+ "id": "DefaultPolicy",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function/ServiceRole/DefaultPolicy",
+ "children": {
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function/ServiceRole/DefaultPolicy/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::IAM::Policy",
+ "aws:cdk:cloudformation:props": {
+ "policyDocument": {
+ "Statement": [
+ {
+ "Action": [
+ "dynamodb:BatchGetItem",
+ "dynamodb:BatchWriteItem",
+ "dynamodb:ConditionCheckItem",
+ "dynamodb:DeleteItem",
+ "dynamodb:DescribeTable",
+ "dynamodb:GetItem",
+ "dynamodb:GetRecords",
+ "dynamodb:GetShardIterator",
+ "dynamodb:PutItem",
+ "dynamodb:Query",
+ "dynamodb:Scan",
+ "dynamodb:UpdateItem"
+ ],
+ "Effect": "Allow",
+ "Resource": [
+ {
+ "Fn::GetAtt": [
+ "WebSocketLogTable7F74AAC5",
+ "Arn"
+ ]
+ },
+ {
+ "Ref": "AWS::NoValue"
+ }
+ ]
+ }
+ ],
+ "Version": "2012-10-17"
+ },
+ "policyName": "DisconnectFunctionServiceRoleDefaultPolicyF5348EC3",
+ "roles": [
+ {
+ "Ref": "DisconnectFunctionServiceRole49DB60AC"
+ }
+ ]
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_iam.CfnPolicy",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_iam.Policy",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_iam.Role",
+ "version": "0.0.0"
+ }
+ },
+ "Code": {
+ "id": "Code",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function/Code",
+ "children": {
+ "Stage": {
+ "id": "Stage",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function/Code/Stage",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.AssetStaging",
+ "version": "0.0.0"
+ }
+ },
+ "AssetBucket": {
+ "id": "AssetBucket",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function/Code/AssetBucket",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_s3.BucketBase",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_s3_assets.Asset",
+ "version": "0.0.0"
+ }
+ },
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/Disconnect Function/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::Lambda::Function",
+ "aws:cdk:cloudformation:props": {
+ "code": {
+ "s3Bucket": {
+ "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
+ },
+ "s3Key": "e593848af17fee558eece2cd2719347804c0c141cff4f8ea1fb8556cf986b5a0.zip"
+ },
+ "environment": {
+ "variables": {
+ "TABLE_NAME": "WebSocketConnections"
+ }
+ },
+ "functionName": "process_disconnect_requests",
+ "handler": "index.handler",
+ "role": {
+ "Fn::GetAtt": [
+ "DisconnectFunctionServiceRole49DB60AC",
+ "Arn"
+ ]
+ },
+ "runtime": "nodejs14.x",
+ "timeout": 5
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_lambda.CfnFunction",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_lambda.Function",
+ "version": "0.0.0"
+ }
+ },
+ "WebSocket Log Table": {
+ "id": "WebSocket Log Table",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket Log Table",
+ "children": {
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket Log Table/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::DynamoDB::Table",
+ "aws:cdk:cloudformation:props": {
+ "attributeDefinitions": [
+ {
+ "attributeName": "ConnectionId",
+ "attributeType": "S"
+ }
+ ],
+ "keySchema": [
+ {
+ "attributeName": "ConnectionId",
+ "keyType": "HASH"
+ }
+ ],
+ "provisionedThroughput": {
+ "readCapacityUnits": 5,
+ "writeCapacityUnits": 5
+ },
+ "tableName": "WebSocketConnections"
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_dynamodb.CfnTable",
+ "version": "0.0.0"
+ }
+ },
+ "ScalingRole": {
+ "id": "ScalingRole",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket Log Table/ScalingRole",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.Resource",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_dynamodb.Table",
+ "version": "0.0.0"
+ }
+ },
+ "WebSocket API": {
+ "id": "WebSocket API",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API",
+ "children": {
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::ApiGatewayV2::Api",
+ "aws:cdk:cloudformation:props": {
+ "name": "webSocket",
+ "protocolType": "WEBSOCKET",
+ "routeSelectionExpression": "$request.body.action"
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnApi",
+ "version": "0.0.0"
+ }
+ },
+ "$connect-Route": {
+ "id": "$connect-Route",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$connect-Route",
+ "children": {
+ "ConnectIntegration-Permission": {
+ "id": "ConnectIntegration-Permission",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$connect-Route/ConnectIntegration-Permission",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::Lambda::Permission",
+ "aws:cdk:cloudformation:props": {
+ "action": "lambda:InvokeFunction",
+ "functionName": {
+ "Fn::GetAtt": [
+ "ConnectFunction4D4B4BB5",
+ "Arn"
+ ]
+ },
+ "principal": "apigateway.amazonaws.com",
+ "sourceArn": {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":execute-api:",
+ {
+ "Ref": "AWS::Region"
+ },
+ ":",
+ {
+ "Ref": "AWS::AccountId"
+ },
+ ":",
+ {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "/*$connect"
+ ]
+ ]
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_lambda.CfnPermission",
+ "version": "0.0.0"
+ }
+ },
+ "ConnectIntegration": {
+ "id": "ConnectIntegration",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$connect-Route/ConnectIntegration",
+ "children": {
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$connect-Route/ConnectIntegration/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::ApiGatewayV2::Integration",
+ "aws:cdk:cloudformation:props": {
+ "apiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "integrationType": "AWS_PROXY",
+ "integrationUri": {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":apigateway:",
+ {
+ "Ref": "AWS::Region"
+ },
+ ":lambda:path/2015-03-31/functions/",
+ {
+ "Fn::GetAtt": [
+ "ConnectFunction4D4B4BB5",
+ "Arn"
+ ]
+ },
+ "/invocations"
+ ]
+ ]
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnIntegration",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.WebSocketIntegration",
+ "version": "0.0.0"
+ }
+ },
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$connect-Route/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::ApiGatewayV2::Route",
+ "aws:cdk:cloudformation:props": {
+ "apiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "authorizationType": "NONE",
+ "routeKey": "$connect",
+ "target": {
+ "Fn::Join": [
+ "",
+ [
+ "integrations/",
+ {
+ "Ref": "WebSocketAPIconnectRouteConnectIntegration2725692A"
+ }
+ ]
+ ]
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnRoute",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.WebSocketRoute",
+ "version": "0.0.0"
+ }
+ },
+ "$disconnect-Route": {
+ "id": "$disconnect-Route",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$disconnect-Route",
+ "children": {
+ "DisconnectIntegration-Permission": {
+ "id": "DisconnectIntegration-Permission",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$disconnect-Route/DisconnectIntegration-Permission",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::Lambda::Permission",
+ "aws:cdk:cloudformation:props": {
+ "action": "lambda:InvokeFunction",
+ "functionName": {
+ "Fn::GetAtt": [
+ "DisconnectFunction620A9610",
+ "Arn"
+ ]
+ },
+ "principal": "apigateway.amazonaws.com",
+ "sourceArn": {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":execute-api:",
+ {
+ "Ref": "AWS::Region"
+ },
+ ":",
+ {
+ "Ref": "AWS::AccountId"
+ },
+ ":",
+ {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "/*$disconnect"
+ ]
+ ]
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_lambda.CfnPermission",
+ "version": "0.0.0"
+ }
+ },
+ "DisconnectIntegration": {
+ "id": "DisconnectIntegration",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$disconnect-Route/DisconnectIntegration",
+ "children": {
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$disconnect-Route/DisconnectIntegration/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::ApiGatewayV2::Integration",
+ "aws:cdk:cloudformation:props": {
+ "apiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "integrationType": "AWS_PROXY",
+ "integrationUri": {
+ "Fn::Join": [
+ "",
+ [
+ "arn:",
+ {
+ "Ref": "AWS::Partition"
+ },
+ ":apigateway:",
+ {
+ "Ref": "AWS::Region"
+ },
+ ":lambda:path/2015-03-31/functions/",
+ {
+ "Fn::GetAtt": [
+ "DisconnectFunction620A9610",
+ "Arn"
+ ]
+ },
+ "/invocations"
+ ]
+ ]
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnIntegration",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.WebSocketIntegration",
+ "version": "0.0.0"
+ }
+ },
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/WebSocket API/$disconnect-Route/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::ApiGatewayV2::Route",
+ "aws:cdk:cloudformation:props": {
+ "apiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "authorizationType": "NONE",
+ "routeKey": "$disconnect",
+ "target": {
+ "Fn::Join": [
+ "",
+ [
+ "integrations/",
+ {
+ "Ref": "WebSocketAPIdisconnectRouteDisconnectIntegration317B9227"
+ }
+ ]
+ ]
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnRoute",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.WebSocketRoute",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.WebSocketApi",
+ "version": "0.0.0"
+ }
+ },
+ "Production Stage": {
+ "id": "Production Stage",
+ "path": "integ-apigwv2-lambda-connect-integration/Production Stage",
+ "children": {
+ "Resource": {
+ "id": "Resource",
+ "path": "integ-apigwv2-lambda-connect-integration/Production Stage/Resource",
+ "attributes": {
+ "aws:cdk:cloudformation:type": "AWS::ApiGatewayV2::Stage",
+ "aws:cdk:cloudformation:props": {
+ "apiId": {
+ "Ref": "WebSocketAPIDA75128A"
+ },
+ "autoDeploy": true,
+ "stageName": "prod"
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.aws_apigatewayv2.CfnStage",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "@aws-cdk/aws-apigatewayv2-alpha.WebSocketStage",
+ "version": "0.0.0"
+ }
+ },
+ "BootstrapVersion": {
+ "id": "BootstrapVersion",
+ "path": "integ-apigwv2-lambda-connect-integration/BootstrapVersion",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.CfnParameter",
+ "version": "0.0.0"
+ }
+ },
+ "CheckBootstrapVersion": {
+ "id": "CheckBootstrapVersion",
+ "path": "integ-apigwv2-lambda-connect-integration/CheckBootstrapVersion",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.CfnRule",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.Stack",
+ "version": "0.0.0"
+ }
+ },
+ "Integ": {
+ "id": "Integ",
+ "path": "Integ",
+ "children": {
+ "DefaultTest": {
+ "id": "DefaultTest",
+ "path": "Integ/DefaultTest",
+ "children": {
+ "Default": {
+ "id": "Default",
+ "path": "Integ/DefaultTest/Default",
+ "constructInfo": {
+ "fqn": "constructs.Construct",
+ "version": "10.2.70"
+ }
+ },
+ "DeployAssert": {
+ "id": "DeployAssert",
+ "path": "Integ/DefaultTest/DeployAssert",
+ "children": {
+ "BootstrapVersion": {
+ "id": "BootstrapVersion",
+ "path": "Integ/DefaultTest/DeployAssert/BootstrapVersion",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.CfnParameter",
+ "version": "0.0.0"
+ }
+ },
+ "CheckBootstrapVersion": {
+ "id": "CheckBootstrapVersion",
+ "path": "Integ/DefaultTest/DeployAssert/CheckBootstrapVersion",
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.CfnRule",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.Stack",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase",
+ "version": "0.0.0"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "@aws-cdk/integ-tests-alpha.IntegTest",
+ "version": "0.0.0"
+ }
+ },
+ "Tree": {
+ "id": "Tree",
+ "path": "Tree",
+ "constructInfo": {
+ "fqn": "constructs.Construct",
+ "version": "10.2.70"
+ }
+ }
+ },
+ "constructInfo": {
+ "fqn": "aws-cdk-lib.App",
+ "version": "0.0.0"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.ts
new file mode 100644
index 0000000000000..8078678f45557
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda-connect-disconnect-trigger.ts
@@ -0,0 +1,81 @@
+import { WebSocketApi, WebSocketStage } from '@aws-cdk/aws-apigatewayv2-alpha';
+import * as cdk from 'aws-cdk-lib';
+import { IntegTest } from '@aws-cdk/integ-tests-alpha';
+import { WebSocketLambdaIntegration } from '../../lib';
+import * as lambda from 'aws-cdk-lib/aws-lambda';
+import * as path from 'path';
+import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
+
+const app = new cdk.App();
+
+const stack = new cdk.Stack(app, 'integ-apigwv2-lambda-connect-integration');
+const webSocketTableName = 'WebSocketConnections';
+
+const connectFunction = new lambda.Function(stack, 'Connect Function', {
+ functionName: 'process_connect_requests',
+ runtime: lambda.Runtime.NODEJS_14_X,
+ handler: 'index.handler',
+ code: lambda.Code.fromAsset(path.join(__dirname, 'lambdas', 'connect')),
+ timeout: cdk.Duration.seconds(5),
+ environment: {
+ TABLE_NAME: webSocketTableName,
+ },
+});
+
+const disconnectFunction = new lambda.Function(
+ stack,
+ 'Disconnect Function',
+ {
+ functionName: 'process_disconnect_requests',
+ runtime: lambda.Runtime.NODEJS_14_X,
+ handler: 'index.handler',
+ code: lambda.Code.fromAsset(
+ path.join(__dirname, 'lambdas', 'disconnect'),
+ ),
+ timeout: cdk.Duration.seconds(5),
+ environment: {
+ TABLE_NAME: webSocketTableName,
+ },
+ },
+);
+
+const webSocketLogTable = new dynamodb.Table(stack, 'WebSocket Log Table', {
+ tableName: webSocketTableName,
+ partitionKey: {
+ name: 'ConnectionId',
+ type: dynamodb.AttributeType.STRING,
+ },
+ removalPolicy: cdk.RemovalPolicy.DESTROY, // not recommended for production
+});
+webSocketLogTable.grantReadWriteData(connectFunction);
+webSocketLogTable.grantReadWriteData(disconnectFunction);
+
+const webSocketConnectIntegration = new WebSocketLambdaIntegration(
+ 'ConnectIntegration',
+ connectFunction,
+);
+const webSocketDisconnectIntegration = new WebSocketLambdaIntegration(
+ 'DisconnectIntegration',
+ disconnectFunction,
+);
+
+const webSocketApi = new WebSocketApi(stack, 'WebSocket API', {
+ apiName: 'webSocket',
+ routeSelectionExpression: '$request.body.action',
+ connectRouteOptions: { integration: webSocketConnectIntegration },
+ disconnectRouteOptions: { integration: webSocketDisconnectIntegration },
+});
+
+new WebSocketStage(
+ stack,
+ 'Production Stage',
+ {
+ webSocketApi: webSocketApi,
+ stageName: 'prod',
+ autoDeploy: true,
+ },
+);
+
+new IntegTest(app, 'Integ', { testCases: [stack] });
+
+app.synth();
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/WebSocketApiInteg.assets.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/WebSocketApiInteg.assets.json
index 806e1a698a8a3..c73ed81c6cb7f 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/WebSocketApiInteg.assets.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/WebSocketApiInteg.assets.json
@@ -1,7 +1,7 @@
{
"version": "34.0.0",
"files": {
- "26e34316c6931e2609524675771603977641dab52471e7fb4c21e998529ed3fd": {
+ "fa386136122b6cd106460ddbdcd437d10712be61617b8d1bf2110a459aa9e233": {
"source": {
"path": "WebSocketApiInteg.template.json",
"packaging": "file"
@@ -9,7 +9,7 @@
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
- "objectKey": "26e34316c6931e2609524675771603977641dab52471e7fb4c21e998529ed3fd.json",
+ "objectKey": "fa386136122b6cd106460ddbdcd437d10712be61617b8d1bf2110a459aa9e233.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/WebSocketApiInteg.template.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/WebSocketApiInteg.template.json
index b6e930b1fa098..e50d8cfbe1645 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/WebSocketApiInteg.template.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/WebSocketApiInteg.template.json
@@ -239,7 +239,7 @@
{
"Ref": "mywsapi32E6CE11"
},
- "/*/*$connect"
+ "/*$connect"
]
]
}
@@ -329,7 +329,7 @@
{
"Ref": "mywsapi32E6CE11"
},
- "/*/*$disconnect"
+ "/*$disconnect"
]
]
}
@@ -419,7 +419,7 @@
{
"Ref": "mywsapi32E6CE11"
},
- "/*/*$default"
+ "/*$default"
]
]
}
@@ -509,7 +509,7 @@
{
"Ref": "mywsapi32E6CE11"
},
- "/*/*sendmessage"
+ "/*sendmessage"
]
]
}
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/manifest.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/manifest.json
index 18f03b2eb267e..1f2c3210e48af 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/manifest.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/manifest.json
@@ -14,10 +14,11 @@
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "WebSocketApiInteg.template.json",
+ "terminationProtection": false,
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
- "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/26e34316c6931e2609524675771603977641dab52471e7fb4c21e998529ed3fd.json",
+ "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fa386136122b6cd106460ddbdcd437d10712be61617b8d1bf2110a459aa9e233.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
@@ -90,7 +91,10 @@
"/WebSocketApiInteg/mywsapi/$connect-Route/ConnectIntegration-Permission": [
{
"type": "aws:cdk:logicalId",
- "data": "mywsapiconnectRouteConnectIntegrationPermission719B6E63"
+ "data": "mywsapiconnectRouteConnectIntegrationPermission719B6E63",
+ "trace": [
+ "!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
+ ]
}
],
"/WebSocketApiInteg/mywsapi/$connect-Route/ConnectIntegration/Resource": [
@@ -108,7 +112,10 @@
"/WebSocketApiInteg/mywsapi/$disconnect-Route/DisconnectIntegration-Permission": [
{
"type": "aws:cdk:logicalId",
- "data": "mywsapidisconnectRouteDisconnectIntegrationPermissionA8197C41"
+ "data": "mywsapidisconnectRouteDisconnectIntegrationPermissionA8197C41",
+ "trace": [
+ "!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
+ ]
}
],
"/WebSocketApiInteg/mywsapi/$disconnect-Route/DisconnectIntegration/Resource": [
@@ -126,7 +133,10 @@
"/WebSocketApiInteg/mywsapi/$default-Route/DefaultIntegration-Permission": [
{
"type": "aws:cdk:logicalId",
- "data": "mywsapidefaultRouteDefaultIntegrationPermission3B7F9CA1"
+ "data": "mywsapidefaultRouteDefaultIntegrationPermission3B7F9CA1",
+ "trace": [
+ "!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
+ ]
}
],
"/WebSocketApiInteg/mywsapi/$default-Route/DefaultIntegration/Resource": [
@@ -144,7 +154,10 @@
"/WebSocketApiInteg/mywsapi/sendmessage-Route/SendMessageIntegration-Permission": [
{
"type": "aws:cdk:logicalId",
- "data": "mywsapisendmessageRouteSendMessageIntegrationPermission92C9841E"
+ "data": "mywsapisendmessageRouteSendMessageIntegrationPermission92C9841E",
+ "trace": [
+ "!!DESTRUCTIVE_CHANGES: WILL_REPLACE"
+ ]
}
],
"/WebSocketApiInteg/mywsapi/sendmessage-Route/SendMessageIntegration/Resource": [
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/tree.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/tree.json
index a3eaa745e06b2..990d79acbeef9 100644
--- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/tree.json
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.js.snapshot/tree.json
@@ -430,7 +430,7 @@
{
"Ref": "mywsapi32E6CE11"
},
- "/*/*$connect"
+ "/*$connect"
]
]
}
@@ -564,7 +564,7 @@
{
"Ref": "mywsapi32E6CE11"
},
- "/*/*$disconnect"
+ "/*$disconnect"
]
]
}
@@ -698,7 +698,7 @@
{
"Ref": "mywsapi32E6CE11"
},
- "/*/*$default"
+ "/*$default"
]
]
}
@@ -832,7 +832,7 @@
{
"Ref": "mywsapi32E6CE11"
},
- "/*/*sendmessage"
+ "/*sendmessage"
]
]
}
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambdas/connect/package.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambdas/connect/package.json
new file mode 100644
index 0000000000000..941efba0e8117
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambdas/connect/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "connect",
+ "version": "1.0.0",
+ "description": "connect example for WebSockets on API Gateway",
+ "main": "index.js",
+ "author": "SAM CLI",
+ "license": "MIT",
+ "dependencies": {
+ "aws-sdk": "^2.690.0"
+ }
+}
diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambdas/disconnect/package.json b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambdas/disconnect/package.json
new file mode 100644
index 0000000000000..f7f07857f72ea
--- /dev/null
+++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambdas/disconnect/package.json
@@ -0,0 +1,11 @@
+{
+ "name": "disconnect",
+ "version": "1.0.0",
+ "description": "disconnect example for WebSockets on API Gateway",
+ "main": "index.js",
+ "author": "SAM CLI",
+ "license": "MIT",
+ "dependencies": {
+ "aws-sdk": "^2.690.0"
+ }
+}
diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.assets.json b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.assets.json
index 9c12eb7d9b585..a2459496af954 100644
--- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.assets.json
+++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/aws-cdk-scheduler-schedule.assets.json
@@ -1,7 +1,7 @@
{
- "version": "33.0.0",
+ "version": "34.0.0",
"files": {
- "70a4ff6207a6b7ce2e7a4354be513e0143bb5f5c671d6826cfb30c010875e4bd": {
+ "eac1c2181558fb8d64de1b029b3b58376b7191ef29b61b4585bdc8f7a45b3671": {
"source": {
"path": "aws-cdk-scheduler-schedule.template.json",
"packaging": "file"
@@ -9,7 +9,7 @@
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
- "objectKey": "70a4ff6207a6b7ce2e7a4354be513e0143bb5f5c671d6826cfb30c010875e4bd.json",
+ "objectKey": "eac1c2181558fb8d64de1b029b3b58376b7191ef29b61b4585bdc8f7a45b3671.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/cdk.out b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/cdk.out
index 560dae10d018f..2313ab5436501 100644
--- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/cdk.out
+++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/cdk.out
@@ -1 +1 @@
-{"version":"33.0.0"}
\ No newline at end of file
+{"version":"34.0.0"}
\ No newline at end of file
diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/integ.json b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/integ.json
index 8bd3af4b50e53..c1aec1a40f53f 100644
--- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/integ.json
+++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/integ.json
@@ -1,5 +1,5 @@
{
- "version": "33.0.0",
+ "version": "34.0.0",
"testCases": {
"integtest-schedule/DefaultTest": {
"stacks": [
diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/integtestscheduleDefaultTestDeployAssert24CB3896.assets.json b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/integtestscheduleDefaultTestDeployAssert24CB3896.assets.json
index 0ec5b6018b44a..8f8a003c1b5ba 100644
--- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/integtestscheduleDefaultTestDeployAssert24CB3896.assets.json
+++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/integtestscheduleDefaultTestDeployAssert24CB3896.assets.json
@@ -1,5 +1,5 @@
{
- "version": "33.0.0",
+ "version": "34.0.0",
"files": {
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
"source": {
diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/manifest.json b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/manifest.json
index 9e6c88e76c10e..482a334a2ce96 100644
--- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/manifest.json
+++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/manifest.json
@@ -1,5 +1,5 @@
{
- "version": "33.0.0",
+ "version": "34.0.0",
"artifacts": {
"aws-cdk-scheduler-schedule.assets": {
"type": "cdk:asset-manifest",
@@ -18,7 +18,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
- "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/70a4ff6207a6b7ce2e7a4354be513e0143bb5f5c671d6826cfb30c010875e4bd.json",
+ "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/eac1c2181558fb8d64de1b029b3b58376b7191ef29b61b4585bdc8f7a45b3671.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
diff --git a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/tree.json b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/tree.json
index 3f5cd77076180..0255afcabc32c 100644
--- a/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/tree.json
+++ b/packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.js.snapshot/tree.json
@@ -450,6 +450,11 @@
"Role1ABCC5F0",
"Arn"
]
+ },
+ "input": "\"Input Text\"",
+ "retryPolicy": {
+ "maximumEventAgeInSeconds": 180,
+ "maximumRetryAttempts": 3
}
}
}