-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathdotnetify-cloudformation-template.yaml
138 lines (126 loc) · 4.2 KB
/
dotnetify-cloudformation-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
AWSTemplateFormatVersion: "2010-09-09"
Description: ""
Resources:
ApiGatewayV2Api:
Type: "AWS::ApiGatewayV2::Api"
Properties:
Name: "dotnetify-api"
ApiKeySelectionExpression: "$request.header.x-api-key"
ProtocolType: "WEBSOCKET"
RouteSelectionExpression: "$request.body.action"
DisableExecuteApiEndpoint: false
ApiGatewayV2Route:
Type: "AWS::ApiGatewayV2::Route"
Properties:
ApiId: !Ref ApiGatewayV2Api
ApiKeyRequired: false
AuthorizationType: "NONE"
RouteKey: "$disconnect"
RouteResponseSelectionExpression: "$default"
Target: !Sub "integrations/${ApiGatewayV2Integration}"
ApiGatewayV2Route2:
Type: "AWS::ApiGatewayV2::Route"
Properties:
ApiId: !Ref ApiGatewayV2Api
ApiKeyRequired: false
AuthorizationType: "NONE"
RouteKey: "$default"
RouteResponseSelectionExpression: "$default"
Target: !Sub "integrations/${ApiGatewayV2Integration2}"
ApiGatewayV2Route3:
Type: "AWS::ApiGatewayV2::Route"
Properties:
ApiId: !Ref ApiGatewayV2Api
ApiKeyRequired: false
AuthorizationType: "NONE"
RouteKey: "$connect"
RouteResponseSelectionExpression: "$default"
Target: !Sub "integrations/${ApiGatewayV2Integration3}"
ApiGatewayV2RouteResponse:
Type: "AWS::ApiGatewayV2::RouteResponse"
Properties:
ApiId: !Ref ApiGatewayV2Api
RouteResponseKey: "$default"
RouteId: !Ref ApiGatewayV2Route2
ApiGatewayV2RouteResponse2:
Type: "AWS::ApiGatewayV2::RouteResponse"
Properties:
ApiId: !Ref ApiGatewayV2Api
RouteResponseKey: "$default"
RouteId: !Ref ApiGatewayV2Route
ApiGatewayV2RouteResponse3:
Type: "AWS::ApiGatewayV2::RouteResponse"
Properties:
ApiId: !Ref ApiGatewayV2Api
RouteResponseKey: "$default"
RouteId: !Ref ApiGatewayV2Route3
ApiGatewayV2Integration:
Type: "AWS::ApiGatewayV2::Integration"
Properties:
ApiId: !Ref ApiGatewayV2Api
ConnectionType: "INTERNET"
IntegrationMethod: "POST"
IntegrationType: "HTTP"
IntegrationUri: "https://<your-url-domain>/api/dotnetify/vm/disconnect"
PassthroughBehavior: "WHEN_NO_MATCH"
RequestTemplates:
"$default": |
{
"connectionId": "$context.connectionId"
}
TemplateSelectionExpression: "\\$default"
TimeoutInMillis: 29000
PayloadFormatVersion: "1.0"
ApiGatewayV2Integration2:
Type: "AWS::ApiGatewayV2::Integration"
Properties:
ApiId: !Ref ApiGatewayV2Api
ConnectionType: "INTERNET"
IntegrationMethod: "POST"
IntegrationType: "HTTP"
IntegrationUri: "https://<your-url-domain>/api/dotnetify/vm"
PassthroughBehavior: "WHEN_NO_MATCH"
RequestTemplates:
"$default": |
{
"connectionId": "$context.connectionId",
"payload": $input.body
}
TemplateSelectionExpression: "\\$default"
TimeoutInMillis: 29000
PayloadFormatVersion: "1.0"
ApiGatewayV2Integration3:
Type: "AWS::ApiGatewayV2::Integration"
Properties:
ApiId: !Ref ApiGatewayV2Api
ConnectionType: "INTERNET"
IntegrationMethod: "POST"
IntegrationType: "HTTP"
IntegrationUri: "https://<your-url-domain>/api/dotnetify/vm"
PassthroughBehavior: "WHEN_NO_MATCH"
RequestTemplates:
"$default": |
{
"connectionId": "$context.connectionId"
}
TemplateSelectionExpression: "\\$default"
TimeoutInMillis: 29000
PayloadFormatVersion: "1.0"
ApiGatewayV2IntegrationResponse:
Type: "AWS::ApiGatewayV2::IntegrationResponse"
Properties:
ApiId: !Ref ApiGatewayV2Api
IntegrationId: !Ref ApiGatewayV2Integration
IntegrationResponseKey: "$default"
ApiGatewayV2IntegrationResponse2:
Type: "AWS::ApiGatewayV2::IntegrationResponse"
Properties:
ApiId: !Ref ApiGatewayV2Api
IntegrationId: !Ref ApiGatewayV2Integration2
IntegrationResponseKey: "$default"
ApiGatewayV2IntegrationResponse3:
Type: "AWS::ApiGatewayV2::IntegrationResponse"
Properties:
ApiId: !Ref ApiGatewayV2Api
IntegrationId: !Ref ApiGatewayV2Integration3
IntegrationResponseKey: "$default"