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
Copy file name to clipboardExpand all lines: docs/providers/aws/events/apigateway.md
+26-2
Original file line number
Diff line number
Diff line change
@@ -1103,6 +1103,7 @@ provider:
1103
1103
apiGateway:
1104
1104
restApiId: xxxxxxxxxx # REST API resource ID. Default is generated by the framework
1105
1105
restApiRootResourceId: xxxxxxxxxx # Root resource, represent as / path
1106
+
websocketApiId: xxxxxxxxxx # Websocket API resource ID. Default is generated by the framewok
1106
1107
description: Some Description # optional - description of deployment history
1107
1108
1108
1109
functions:
@@ -1119,6 +1120,7 @@ provider:
1119
1120
apiGateway:
1120
1121
restApiId: xxxxxxxxxx
1121
1122
restApiRootResourceId: xxxxxxxxxx
1123
+
websocketApiId: xxxxxxxxxx
1122
1124
description: Some Description
1123
1125
1124
1126
functions:
@@ -1136,6 +1138,7 @@ provider:
1136
1138
apiGateway:
1137
1139
restApiId: xxxxxxxxxx
1138
1140
restApiRootResourceId: xxxxxxxxxx
1141
+
websocketApiId: xxxxxxxxxx
1139
1142
description: Some Description
1140
1143
1141
1144
functions:
@@ -1155,6 +1158,7 @@ provider:
1155
1158
apiGateway:
1156
1159
restApiId: xxxxxxxxxx
1157
1160
restApiRootResourceId: xxxxxxxxxx
1161
+
websocketApiId: xxxxxxxxxx
1158
1162
description: Some Description
1159
1163
restApiResources:
1160
1164
/posts: xxxxxxxxxx
@@ -1170,6 +1174,7 @@ provider:
1170
1174
apiGateway:
1171
1175
restApiId: xxxxxxxxxx
1172
1176
restApiRootResourceId: xxxxxxxxxx
1177
+
websocketApiId: xxxxxxxxxx
1173
1178
description: Some Description
1174
1179
restApiResources:
1175
1180
/posts: xxxxxxxxxx
@@ -1188,6 +1193,7 @@ provider:
1188
1193
apiGateway:
1189
1194
restApiId: xxxxxxxxxx
1190
1195
# restApiRootResourceId: xxxxxxxxxx # Optional
1196
+
websocketApiId: xxxxxxxxxx
1191
1197
description: Some Description
1192
1198
restApiResources:
1193
1199
/posts: xxxxxxxxxx
@@ -1213,7 +1219,7 @@ functions:
1213
1219
1214
1220
### Easiest and CI/CD friendly example of using shared API Gateway and API Resources.
1215
1221
1216
-
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.
1217
1223
1218
1224
```yml
1219
1225
service: my-api
@@ -1231,6 +1237,13 @@ resources:
1231
1237
Properties:
1232
1238
Name: MyApiGW
1233
1239
1240
+
MyWebsocketApi:
1241
+
Type: AWS::ApiGatewayV2::Api
1242
+
Properties:
1243
+
Name: MyWebsocketApi
1244
+
ProtocolType: WEBSOCKET
1245
+
RouteSelectionExpression: '$request.body.action'
1246
+
1234
1247
Outputs:
1235
1248
apiGatewayRestApiId:
1236
1249
Value:
@@ -1245,9 +1258,16 @@ resources:
1245
1258
- RootResourceId
1246
1259
Export:
1247
1260
Name: MyApiGateway-rootResourceId
1261
+
1262
+
websocketApiId:
1263
+
Value:
1264
+
Ref: MyWebsocketApi
1265
+
Export:
1266
+
Name: MyApiGateway-websocketApiId
1267
+
1248
1268
```
1249
1269
1250
-
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.
1251
1271
We will import this and reference in future services.
0 commit comments