Skip to content

feat: add metadata to LambdaResource #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/frameworks/cdkFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ export class CdkFramework implements IFramework {
define: lambdaInCdk.bundling?.define,
external: external.length > 0 ? external : undefined,
},
metadata: {
framework: 'cdk',
stackName: lambdaInCdk.stackName,
cdkPath: lambdaInCdk.cdkPath,
},
});
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/frameworks/samFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ export class SamFramework implements IFramework {
handler,
packageJsonPath,
esBuildOptions,
metadata: {
framework: 'sam',
stackName,
},
};

lambdasDiscovered.push(lambdaResource);
Expand Down
3 changes: 3 additions & 0 deletions src/frameworks/slsFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ export class SlsFramework implements IFramework {
handler,
packageJsonPath,
esBuildOptions,
metadata: {
framework: 'sls',
},
};

lambdasDiscovered.push(lambdaResource);
Expand Down
3 changes: 3 additions & 0 deletions src/frameworks/terraformFramework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ export class TerraformFramework implements IFramework {
handler,
packageJsonPath,
esBuildOptions: undefined,
metadata: {
framework: 'terraform',
},
};

lambdasDiscovered.push(lambdaResource);
Expand Down
16 changes: 16 additions & 0 deletions src/types/resourcesDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ export type LambdaResource = {
forceBundle?: boolean;
bundlingType?: BundlingType;
esBuildOptions?: EsBuildOptions;
metadata: {
/**
* Framework name
*/
framework: string;

/**
* If framework is CDK or SAM, this is the stack name
*/
stackName?: string;

/**
* If framework is CDK, this is the construct path
*/
cdkPath?: string;
};
};

export enum BundlingType {
Expand Down
Loading