From 09657ee63bd529c3ace96c4ddfff1d43b5bc5c68 Mon Sep 17 00:00:00 2001 From: Aponia Date: Thu, 21 Dec 2023 13:05:02 -0800 Subject: [PATCH] =?UTF-8?q?fix(api):=20=F0=9F=90=9B=20merge=20construct=20?= =?UTF-8?q?props=20and=20function=20props=20correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the root function props were overriding the route-specific ones --- apps/api/src/routes/v1/rest/websoc/+config.ts | 3 ++- apps/api/src/routes/v1/rest/websoc/{id}/+config.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/api/src/routes/v1/rest/websoc/+config.ts b/apps/api/src/routes/v1/rest/websoc/+config.ts index acbad080..50d409d0 100644 --- a/apps/api/src/routes/v1/rest/websoc/+config.ts +++ b/apps/api/src/routes/v1/rest/websoc/+config.ts @@ -12,7 +12,9 @@ import { constructs, esbuildOptions } from "../../../../../bronya.config"; export const overrides: ApiPropsOverride = { constructs: { + ...constructs, functionProps: (scope, id) => ({ + ...constructs.functionProps(scope, id), role: new Role(scope, `${id}-v1-rest-websoc-role`, { assumedBy: new ServicePrincipal("lambda.amazonaws.com"), managedPolicies: [ @@ -33,7 +35,6 @@ export const overrides: ApiPropsOverride = { }, }), }), - ...constructs, }, esbuild: { ...esbuildOptions, diff --git a/apps/api/src/routes/v1/rest/websoc/{id}/+config.ts b/apps/api/src/routes/v1/rest/websoc/{id}/+config.ts index aab8d96b..90b01ebe 100644 --- a/apps/api/src/routes/v1/rest/websoc/{id}/+config.ts +++ b/apps/api/src/routes/v1/rest/websoc/{id}/+config.ts @@ -12,7 +12,9 @@ import { constructs, esbuildOptions } from "../../../../../../bronya.config"; export const overrides: ApiPropsOverride = { constructs: { + ...constructs, functionProps: (scope, id) => ({ + ...constructs.functionProps(scope, id), role: new Role(scope, `${id}-v1-rest-websoc-id-role`, { assumedBy: new ServicePrincipal("lambda.amazonaws.com"), managedPolicies: [ @@ -33,7 +35,6 @@ export const overrides: ApiPropsOverride = { }, }), }), - ...constructs, }, esbuild: { ...esbuildOptions,