-
Notifications
You must be signed in to change notification settings - Fork 30
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
chore: Make helpers take one, not multiple Lambda functions (5/x) #343
Conversation
addCdkConstructVersionTag(extractedLambdaFunctions); | ||
addCdkConstructVersionTag(lambdaFunction); | ||
applyEnvVariables(lambdaFunction, baseProps); | ||
} | ||
|
||
applyEnvVariables(extractedLambdaFunctions, baseProps); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving them into the for loop
log.debug(`Adding CDK Construct version tag: ${versionJson.version}`); | ||
lambdaFunctions.forEach((functionName) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of the forEach loop
log.debug(`Setting environment variables...`); | ||
lambdas.forEach((lam) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid of the forEach loop
/merge |
Devflow running:
|
Context of this PR series
The end goal of this series of PRs is to abort the instrumentation of a Lambda function if its runtime is not supported, while still instrument other Lambda functions. More in #314
However, this behavior is hard to implement under the current code structure:
If one of the steps skips a Lambda function, it's hard for the subsequent steps to know this and thus skip the Lambda function.
Therefore, at the end of day, I'm going to change the code structure to:
to make it possible to implement this behavior.
What does this PR do?
This PR makes these helper functions to take a single Lambda function instead of multiple ones:
addCdkConstructVersionTag()
applyEnvVariables()
It's not supposed to change code behavior.
I'll handle other helper functions in separate PRs, to keep each PR small and easy to review.
Testing Guidelines
Run snapshot tests:
aws-vault exec sso-serverless-sandbox-account-admin -- scripts/run_integration_tests.sh
to ensure the generated CloudFormation template for the test stacks are not changed.Additional Notes
Types of Changes
Check all that apply