Closed lym953 closed 2 weeks ago
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 https://github.com/DataDog/datadog-cdk-constructs/issues/314
However, this behavior is hard to implement under the current code structure:
public addLambdaFunctions() { grantReadLambdas(lambdas); applyLayers(lambdas); applyExtensionLayer(lambdas); ... }
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:
public addLambdaFunctions() { for (lambda : lambdas) { addLambdaFunction(lambda); } } public addLambdaFunction() { if (!grantReadLambda(lambda)) { return; } if (!applyLayers(lambda)) { return; } ... }
to make it possible to implement this behavior.
This PR makes these helper functions to take a single Lambda function instead of multiple ones:
grantReadLambdas()
grantReadLambdasFromSecretArn()
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.
Run snapshot tests: aws-vault exec sso-serverless-sandbox-account-admin -- scripts/run_integration_tests.sh
aws-vault exec sso-serverless-sandbox-account-admin -- scripts/run_integration_tests.sh
/merge
View all feedbacks in Devflow UI.
2024-11-07 15:54:16 UTC :information_source: MergeQueue: pull request added to the queue
2024-11-07 15:54:16 UTC
The median merge time in main is 8m.
main
Context
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 https://github.com/DataDog/datadog-cdk-constructs/issues/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:
grantReadLambdas()
grantReadLambdasFromSecretArn()
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
Additional Notes
Types of Changes
Check all that apply