Skip to content

Commit 2297ac8

Browse files
authored
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
1 parent 8a35d1e commit 2297ac8

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

aws/lambda-api/lambda.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ resource "aws_lambda_function" "api" {
2020
]
2121
subnet_ids = var.vpc_private_subnets
2222
}
23-
2423
environment {
2524
variables = {
2625
ADMIN_CLIENT_SECRET = var.admin_client_secret
@@ -34,10 +33,14 @@ resource "aws_lambda_function" "api" {
3433
DOCUMENTS_BUCKET = var.documents_bucket
3534
ENVIRONMENT = var.env
3635
MLWR_HOST = var.mlwr_host
36+
NEW_RELIC_LAMBDA_HANDLER = "application.handler"
37+
NEW_RELIC_ACCOUNT_ID = var.new_relic_account_id
3738
NEW_RELIC_APP_NAME = var.new_relic_app_name
3839
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED = var.new_relic_distribution_tracing_enabled
3940
NEW_RELIC_LICENSE_KEY = var.new_relic_license_key
4041
NEW_RELIC_MONITOR_MODE = var.new_relic_monitor_mode
42+
NEW_RELIC_EXTENSION_LOGS_ENABLED = true
43+
NEW_RELIC_LAMBDA_EXTENSION_ENABLED = true
4144
NOTIFICATION_QUEUE_PREFIX = var.notification_queue_prefix
4245
NOTIFY_EMAIL_DOMAIN = var.domain
4346
NOTIFY_ENVIRONMENT = var.env

aws/lambda-api/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ locals {
149149
api_lambda_log_group = "/aws/lambda/api-lambda"
150150
}
151151

152+
variable "new_relic_account_id" {
153+
type = string
154+
}
155+
152156
variable "ff_batch_insertion" {
153157
type = bool
154158
}

env/terragrunt.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ inputs = {
1212
elb_account_ids = {
1313
"ca-central-1" = "985666609251"
1414
}
15+
new_relic_account_id = "2691974"
1516
}
1617

1718
generate "provider" {

0 commit comments

Comments
 (0)