diff --git a/apps/api/src/routes/v1/rest/websoc/+config.ts b/apps/api/src/routes/v1/rest/websoc/+config.ts index acbad080..2367b871 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..edcbedde 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,