Skip to content

Commit

Permalink
feat: use lambda layer and newrelic lambda handler wrapper (#415)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mohdnr authored Mar 17, 2022
1 parent 8a35d1e commit 2297ac8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aws/lambda-api/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ resource "aws_lambda_function" "api" {
]
subnet_ids = var.vpc_private_subnets
}

environment {
variables = {
ADMIN_CLIENT_SECRET = var.admin_client_secret
Expand All @@ -34,10 +33,14 @@ resource "aws_lambda_function" "api" {
DOCUMENTS_BUCKET = var.documents_bucket
ENVIRONMENT = var.env
MLWR_HOST = var.mlwr_host
NEW_RELIC_LAMBDA_HANDLER = "application.handler"
NEW_RELIC_ACCOUNT_ID = var.new_relic_account_id
NEW_RELIC_APP_NAME = var.new_relic_app_name
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED = var.new_relic_distribution_tracing_enabled
NEW_RELIC_LICENSE_KEY = var.new_relic_license_key
NEW_RELIC_MONITOR_MODE = var.new_relic_monitor_mode
NEW_RELIC_EXTENSION_LOGS_ENABLED = true
NEW_RELIC_LAMBDA_EXTENSION_ENABLED = true
NOTIFICATION_QUEUE_PREFIX = var.notification_queue_prefix
NOTIFY_EMAIL_DOMAIN = var.domain
NOTIFY_ENVIRONMENT = var.env
Expand Down
4 changes: 4 additions & 0 deletions aws/lambda-api/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ locals {
api_lambda_log_group = "/aws/lambda/api-lambda"
}

variable "new_relic_account_id" {
type = string
}

variable "ff_batch_insertion" {
type = bool
}
Expand Down
1 change: 1 addition & 0 deletions env/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ inputs = {
elb_account_ids = {
"ca-central-1" = "985666609251"
}
new_relic_account_id = "2691974"
}

generate "provider" {
Expand Down

0 comments on commit 2297ac8

Please sign in to comment.