Skip to content

Commit

Permalink
Capture route constructs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lepozepo committed Feb 20, 2020
1 parent b65d139 commit 71659e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/WebsocketApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
});
}
}
Expand Down

0 comments on commit 71659e7

Please sign in to comment.