You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Available Status Codes](#Available-Status-Codes)
41
-
-[Using Status Codes](#Using-Status-Codes)
42
-
-[Custom Status Codes](#Custom-Status-Codes)
43
-
-[Setting an HTTP Proxy on API Gateway](#Setting-an-HTTP-Proxy-on-API-Gateway)
44
-
-[Share API Gateway and API Resources](#Share-API-Gateway-and-API-Resources)
45
-
-[Easiest and CI/CD friendly example of using shared API Gateway and API Resources.](#Easiest-and-CICD-friendly-example-of-using-shared-API-Gateway-and-API-Resources)
46
-
-[Manually Configuring shared API Gateway](#Manually-Configuring-shared-API-Gateway)
47
-
-[Note while using authorizers with shared API Gateway](#Note-while-using-authorizers-with-shared-API-Gateway)
-[Available Status Codes](#available-status-codes)
40
+
-[Using Status Codes](#using-status-codes)
41
+
-[Custom Status Codes](#custom-status-codes)
42
+
-[Setting an HTTP Proxy on API Gateway](#setting-an-http-proxy-on-api-gateway)
43
+
-[Share API Gateway and API Resources](#share-api-gateway-and-api-resources)
44
+
-[Easiest and CI/CD friendly example of using shared API Gateway and API Resources.](#easiest-and-cicd-friendly-example-of-using-shared-api-gateway-and-api-resources)
45
+
-[Manually Configuring shared API Gateway](#manually-configuring-shared-api-gateway)
46
+
-[Note while using authorizers with shared API Gateway](#note-while-using-authorizers-with-shared-api-gateway)
47
+
-[Share Authorizer](#share-authorizer)
48
+
-[Resource Policy](#resource-policy)
49
+
-[Compression](#compression)
50
+
-[Binary Media Types](#binary-media-types)
51
+
-[AWS X-Ray Tracing](#aws-x-ray-tracing)
52
+
-[Tags / Stack Tags](#tags--stack-tags)
53
+
-[Logs](#logs)
55
54
56
55
_Are you looking for tutorials on using API Gateway? Check out the following resources:_
57
56
@@ -1104,6 +1103,7 @@ provider:
1104
1103
apiGateway:
1105
1104
restApiId: xxxxxxxxxx # REST API resource ID. Default is generated by the framework
1106
1105
restApiRootResourceId: xxxxxxxxxx # Root resource, represent as / path
1106
+
websocketApiId: xxxxxxxxxx # Websocket API resource ID. Default is generated by the framewok
1107
1107
description: Some Description # optional - description of deployment history
1108
1108
1109
1109
functions:
@@ -1120,6 +1120,7 @@ provider:
1120
1120
apiGateway:
1121
1121
restApiId: xxxxxxxxxx
1122
1122
restApiRootResourceId: xxxxxxxxxx
1123
+
websocketApiId: xxxxxxxxxx
1123
1124
description: Some Description
1124
1125
1125
1126
functions:
@@ -1137,6 +1138,7 @@ provider:
1137
1138
apiGateway:
1138
1139
restApiId: xxxxxxxxxx
1139
1140
restApiRootResourceId: xxxxxxxxxx
1141
+
websocketApiId: xxxxxxxxxx
1140
1142
description: Some Description
1141
1143
1142
1144
functions:
@@ -1156,6 +1158,7 @@ provider:
1156
1158
apiGateway:
1157
1159
restApiId: xxxxxxxxxx
1158
1160
restApiRootResourceId: xxxxxxxxxx
1161
+
websocketApiId: xxxxxxxxxx
1159
1162
description: Some Description
1160
1163
restApiResources:
1161
1164
posts: xxxxxxxxxx
@@ -1171,6 +1174,7 @@ provider:
1171
1174
apiGateway:
1172
1175
restApiId: xxxxxxxxxx
1173
1176
restApiRootResourceId: xxxxxxxxxx
1177
+
websocketApiId: xxxxxxxxxx
1174
1178
description: Some Description
1175
1179
restApiResources:
1176
1180
/posts: xxxxxxxxxx
@@ -1189,6 +1193,7 @@ provider:
1189
1193
apiGateway:
1190
1194
restApiId: xxxxxxxxxx
1191
1195
# restApiRootResourceId: xxxxxxxxxx # Optional
1196
+
websocketApiId: xxxxxxxxxx
1192
1197
description: Some Description
1193
1198
restApiResources:
1194
1199
/posts: xxxxxxxxxx
@@ -1214,7 +1219,7 @@ functions:
1214
1219
1215
1220
### Easiest and CI/CD friendly example of using shared API Gateway and API Resources.
1216
1221
1217
-
You can define your API Gateway resource in its own service and export the `restApiId`and `restApiRootResourceId` using cloudformation cross-stack references.
1222
+
You can define your API Gateway resource in its own service and export the `restApiId`, `restApiRootResourceId` and `websocketApiId` using cloudformation cross-stack references.
1218
1223
1219
1224
```yml
1220
1225
service: my-api
@@ -1232,6 +1237,13 @@ resources:
1232
1237
Properties:
1233
1238
Name: MyApiGW
1234
1239
1240
+
MyWebsocketApi:
1241
+
Type: AWS::ApiGatewayV2::Api
1242
+
Properties:
1243
+
Name: MyWebsocketApi
1244
+
ProtocolType: WEBSOCKET
1245
+
RouteSelectionExpression: '$request.body.action'
1246
+
1235
1247
Outputs:
1236
1248
apiGatewayRestApiId:
1237
1249
Value:
@@ -1246,9 +1258,16 @@ resources:
1246
1258
- RootResourceId
1247
1259
Export:
1248
1260
Name: MyApiGateway-rootResourceId
1261
+
1262
+
websocketApiId:
1263
+
Value:
1264
+
Ref: MyWebsocketApi
1265
+
Export:
1266
+
Name: MyApiGateway-websocketApiId
1267
+
1249
1268
```
1250
1269
1251
-
This creates API gateway and then exports the `restApiId`and `rootResourceId` values using cloudformation cross stack output.
1270
+
This creates API gateway and then exports the `restApiId`, `rootResourceId` and `websocketApiId` values using cloudformation cross stack output.
1252
1271
We will import this and reference in future services.
0 commit comments