-
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.
feat(aws-apigatewayv2): add support for api-key in websocket apis
- Loading branch information
1 parent
6390cb5
commit a0723b6
Showing
8 changed files
with
140 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
13 changes: 13 additions & 0 deletions
13
packages/@aws-cdk/aws-apigatewayv2/test/websocket/integ.api-apikey.expected.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,13 @@ | ||
{ | ||
"Resources": { | ||
"MyWebsocketApiEBAC53DF": { | ||
"Type": "AWS::ApiGatewayV2::Api", | ||
"Properties": { | ||
"ApiKeySelectionExpression": "$request.header.x-api-key", | ||
"Name": "MyWebsocketApi", | ||
"ProtocolType": "WEBSOCKET", | ||
"RouteSelectionExpression": "$request.body.action" | ||
} | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/@aws-cdk/aws-apigatewayv2/test/websocket/integ.api-apikey.ts
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,14 @@ | ||
#!/usr/bin/env node | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as apigw from '../../lib'; | ||
import { ApiKeySelectionExpression } from '../../lib'; | ||
|
||
const app = new cdk.App(); | ||
|
||
const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2-websockets'); | ||
|
||
new apigw.WebSocketApi(stack, 'MyWebsocketApi', { | ||
apiKeySelectionExpression: ApiKeySelectionExpression.X_API_KEY, | ||
}); | ||
|
||
app.synth(); |
12 changes: 12 additions & 0 deletions
12
packages/@aws-cdk/aws-apigatewayv2/test/websocket/integ.api-default.expected.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,12 @@ | ||
{ | ||
"Resources": { | ||
"MyWebsocketApiEBAC53DF": { | ||
"Type": "AWS::ApiGatewayV2::Api", | ||
"Properties": { | ||
"Name": "MyWebsocketApi", | ||
"ProtocolType": "WEBSOCKET", | ||
"RouteSelectionExpression": "$request.body.action" | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/@aws-cdk/aws-apigatewayv2/test/websocket/integ.api-default.ts
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,11 @@ | ||
#!/usr/bin/env node | ||
import * as cdk from '@aws-cdk/core'; | ||
import * as apigw from '../../lib'; | ||
|
||
const app = new cdk.App(); | ||
|
||
const stack = new cdk.Stack(app, 'aws-cdk-aws-apigatewayv2-websockets'); | ||
|
||
new apigw.WebSocketApi(stack, 'MyWebsocketApi'); | ||
|
||
app.synth(); |
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