Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

Commit e7a92cc

Browse files
author
cfraz89
authored
feat: Resource plugin framework (#573)
- Implements loading resources into lambdas as initial feature provided by plugins - Loaders support exporting environment variables and providing transformers for a resource, for local and synth targets - Implements loaders for dynamo table and step functions
1 parent 3bf2a9a commit e7a92cc

36 files changed

Lines changed: 1595 additions & 1062 deletions

File tree

packages/@functionless/aws-apigateway/src/method.ts

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -91,36 +91,21 @@ export function Method<
9191
const props = typeof handlerOrProps === "object" ? handlerOrProps : undefined;
9292

9393
function method(event: APIGatewayProxyEvent, ...args: any[]) {
94-
/* eslint-disable turbo/no-undeclared-env-vars */
95-
if (
96-
// @ts-ignore
97-
process.env.RESOURCE_ID === handler.resourceId ||
98-
process.env.FL_LOCAL === "true"
99-
) {
100-
/* eslint-enable turbo/no-undeclared-env-vars */
101-
const merged: ApiRequestEvent<RequestEvent> = {
102-
...(event.body ? JSON.parse(event.body) : {}),
103-
...event.pathParameters,
104-
_request: event,
105-
};
106-
107-
// this is the API being invoked
108-
// @ts-ignore
109-
return handler(merged, ...args);
110-
} else {
111-
// this is a Lambda Function directly invoking this API
112-
// axios
113-
throw new Error("Not Implemented");
114-
}
94+
/* eslint-enable turbo/no-undeclared-env-vars */
95+
const merged: ApiRequestEvent<RequestEvent> = {
96+
...(event.body ? JSON.parse(event.body) : {}),
97+
...event.pathParameters,
98+
_request: event,
99+
};
100+
101+
// this is the API being invoked
102+
// @ts-ignore
103+
return handler(merged, ...args);
115104
}
116105
Object.assign(method, <Method<RequestEvent, Result>>{
117106
kind: MethodKind,
118107
handler,
119108
props,
120109
});
121-
Object.defineProperty(handler, "RESOURCE_ID", {
122-
// @ts-ignore
123-
get: () => method.RESOURCE_ID,
124-
});
125110
return method as any;
126111
}

packages/@functionless/aws-dynamodb/src/client-factory.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)