-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: use lambda layer and newrelic lambda handler wrapper #415
Conversation
4361bd5
to
db5f453
Compare
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.
Let's try this out!
Need to make changes to notification-api before this moves forward. Putting this back to draft until then |
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.
Alright I'll remove my review and fictive request some changes until it's ready.
607f342
to
63ac732
Compare
Staging: lambda-api✅ Terraform Format: Plan: 4 to add, 1 to change, 4 to destroy Show planResource actions are indicated with the following symbols:
~ update in-place
-/+ destroy and then create replacement
Terraform will perform the following actions:
# aws_appautoscaling_scheduled_action.api-5pm must be replaced
-/+ resource "aws_appautoscaling_scheduled_action" "api-5pm" {
~ arn = "arn:aws:autoscaling:ca-central-1:239043911459:scheduledAction:39be2884-1a2d-4686-b62f-4c31d1c89c01:resource/lambda/function:api-lambda:14:scheduledActionName/api-5pm" -> (known after apply)
~ id = "api-5pm-lambda-function:api-lambda:14" -> (known after apply)
name = "api-5pm"
~ resource_id = "function:api-lambda:14" -> (known after apply) # forces replacement
# (4 unchanged attributes hidden)
# (1 unchanged block hidden)
}
# aws_appautoscaling_scheduled_action.api-noon must be replaced
-/+ resource "aws_appautoscaling_scheduled_action" "api-noon" {
~ arn = "arn:aws:autoscaling:ca-central-1:239043911459:scheduledAction:39be2884-1a2d-4686-b62f-4c31d1c89c01:resource/lambda/function:api-lambda:14:scheduledActionName/api-noon" -> (known after apply)
~ id = "api-noon-lambda-function:api-lambda:14" -> (known after apply)
name = "api-noon"
~ resource_id = "function:api-lambda:14" -> (known after apply) # forces replacement
# (4 unchanged attributes hidden)
# (1 unchanged block hidden)
}
# aws_appautoscaling_target.api must be replaced
-/+ resource "aws_appautoscaling_target" "api" {
~ id = "function:api-lambda:14" -> (known after apply)
~ max_capacity = 5 -> 10
~ resource_id = "function:api-lambda:14" -> (known after apply) # forces replacement
~ role_arn = "arn:aws:iam::239043911459:role/aws-service-role/lambda.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_LambdaConcurrency" -> (known after apply)
# (3 unchanged attributes hidden)
}
# aws_lambda_function.api will be updated in-place
~ resource "aws_lambda_function" "api" {
id = "api-lambda"
~ qualified_arn = "arn:aws:lambda:ca-central-1:239043911459:function:api-lambda:14" -> (known after apply)
tags = {}
~ version = "14" -> (known after apply)
# (23 unchanged attributes hidden)
~ environment {
~ variables = {
+ "NEW_RELIC_ACCOUNT_ID" = "2691974"
+ "NEW_RELIC_EXTENSION_LOGS_ENABLED" = "true"
+ "NEW_RELIC_LAMBDA_EXTENSION_ENABLED" = "true"
+ "NEW_RELIC_LAMBDA_HANDLER" = "application.handler"
# (29 unchanged elements hidden)
}
}
# (2 unchanged blocks hidden)
}
# aws_lambda_provisioned_concurrency_config.api must be replaced
-/+ resource "aws_lambda_provisioned_concurrency_config" "api" {
~ id = "api-lambda:14" -> (known after apply)
~ qualifier = "14" -> (known after apply) # forces replacement
# (2 unchanged attributes hidden)
}
Plan: 4 to add, 1 to change, 4 to destroy.
─────────────────────────────────────────────────────────────────────────────
Saved the plan to: plan.tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "plan.tfplan"
Releasing state lock. This may take a few moments...
Show Conftest resultsWARN - plan.json - main - Missing Common Tags: ["aws_api_gateway_domain_name.api"]
WARN - plan.json - main - Missing Common Tags: ["aws_api_gateway_domain_name.api_lambda"]
WARN - plan.json - main - Missing Common Tags: ["aws_api_gateway_rest_api.api"]
WARN - plan.json - main - Missing Common Tags: ["aws_api_gateway_stage.api"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.api_gateway_log_group"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_log_group.notification-canada-ca-api-lambda-waf-logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.logs-1-error-1-minute-warning-lambda-api"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudwatch_metric_alarm.logs-10-error-5-minutes-critical-lambda-api"]
WARN - plan.json - main - Missing Common Tags: ["aws_ecr_repository.api-lambda"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.api"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_policy.ecr"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.api"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.api_cloudwatch"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_user.ecr-user"]
WARN - plan.json - main - Missing Common Tags: ["aws_lambda_function.api"]
WARN - plan.json - main - Missing Common Tags: ["aws_secretsmanager_secret.ecr-user-access-key"]
WARN - plan.json - main - Missing Common Tags: ["aws_wafv2_web_acl.api_lambda"]
33 tests, 16 passed, 17 warnings, 0 failures, 0 exceptions
|
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.
* feat: use lambda layer and cloudwatch for newrelic logs * feat: send to cloudwatch for now * chore: remove lambda layer integration * chore: remove layer * feat: go back to layer and wrapping the handler * chore: remove layer * chore: more envs * chore: remove duplicate env
* feat: use lambda layer and newrelic lambda handler wrapper (#415) * feat: use lambda layer and cloudwatch for newrelic logs * feat: send to cloudwatch for now * chore: remove lambda layer integration * chore: remove layer * feat: go back to layer and wrapping the handler * chore: remove layer * chore: more envs * chore: remove duplicate env * chore: remove unused variables * chore: remove unused secretmanager
Setup environment variables required for the lambda api to successfully integrate with newrelic
related: