-
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 (6/x) #344
Conversation
@@ -120,42 +120,40 @@ export function applyEnvVariables(lam: lambda.Function, baseProps: DatadogLambda | |||
} | |||
} | |||
|
|||
export function setDDEnvVariables(lambdas: lambda.Function[], props: DatadogLambdaProps): void { | |||
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.
Only indentation changes.
src/datadog-lambda.ts
Outdated
setTags(lambdaFunction, props); | ||
} | ||
}); | ||
function setTagsForFunctions(lambdaFunction: lambda.Function, props: DatadogLambdaProps): void { |
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.
nit: should we rename it to setTagsForFunction
now that it only takes in one?
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.
Good catch! Will fix.
0a93c29
to
2912f49
Compare
/merge |
Devflow running:
|
2912f49
to
d78bde2
Compare
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:
setDDEnvVariables()
setTagsForFunctions()
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