Skip to content

Commit 2f08e3f

Browse files
Chore: [AEA-0000] - exclude unneeded code from lambdas (#447)
## Summary **Remove items from this list if they are not relevant. Remove this line once this has been done** - Routine Change ### Details excludes tests
1 parent 47ae071 commit 2f08e3f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

packages/cdk/constructs/LambdaFunction.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface LambdaFunctionProps {
2424
readonly functionName: string
2525
readonly packageBasePath: string
2626
readonly handler: string
27-
readonly environmentVariables?: {[key: string]: string}
27+
readonly environmentVariables?: { [key: string]: string }
2828
readonly additionalPolicies?: Array<IManagedPolicy>
2929
readonly logRetentionInDays: number
3030
readonly logLevel: string
@@ -134,7 +134,15 @@ export class LambdaFunction extends Construct {
134134
timeout: Duration.seconds(50),
135135
architecture: Architecture.X86_64,
136136
handler: props.handler,
137-
code: Code.fromAsset(props.packageBasePath),
137+
code: Code.fromAsset(props.packageBasePath, {
138+
exclude: [
139+
"tests",
140+
"pytest.ini",
141+
".vscode",
142+
"__pycache__",
143+
"*.pyc"
144+
]
145+
}),
138146
role,
139147
environment: {
140148
...props.environmentVariables,

0 commit comments

Comments
 (0)