From 71659e75c11d60df3546840992575bfd62990a83 Mon Sep 17 00:00:00 2001 From: Marcelo Reyna Date: Thu, 20 Feb 2020 13:08:18 -0800 Subject: [PATCH] Capture route constructs --- src/WebsocketApi.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/WebsocketApi.js b/src/WebsocketApi.js index 8e2b8c6..1fc2c7f 100644 --- a/src/WebsocketApi.js +++ b/src/WebsocketApi.js @@ -210,8 +210,9 @@ export default class WebsocketApi extends pulumi.ComponentResource { const api = new Api(name, { name, ...props, _credentials }, { parent: this }); + const routeConstructs = {}; if (props.routes) { - Object.entries(props.routes).map(async ([routeKey, routeProps]) => { + Object.entries(props.routes).forEach(([routeKey, routeProps]) => { const integration = new Integration(`intg-${routeKey}`, { apiId: api.id, integrationUri: routeProps.eventHandler.invokeArn, @@ -223,6 +224,9 @@ export default class WebsocketApi extends pulumi.ComponentResource { integrationId: integration.id, _credentials, }, { parent: this }); + + routeConstructs[`intg-${routeKey}`] = integration; + routeConstructs[`route-${routeKey}`] = route; }); } }