diff --git a/infrastructure/terraform/modules/lambda/README.md b/infrastructure/terraform/modules/lambda/README.md
index d84520a..778274e 100644
--- a/infrastructure/terraform/modules/lambda/README.md
+++ b/infrastructure/terraform/modules/lambda/README.md
@@ -40,7 +40,7 @@ output "processor_lambda_error_rate_alarm_arn" {
| [enable\_dlq\_messages\_alarm](#input\_enable\_dlq\_messages\_alarm) | Create a CloudWatch alarm when visible messages are present in the Lambda DLQ | `bool` | `true` | no |
| [enable\_duration\_alarm](#input\_enable\_duration\_alarm) | Create a CloudWatch alarm when Lambda duration percentile exceeds the configured threshold | `bool` | `true` | no |
| [enable\_error\_rate\_alarm](#input\_enable\_error\_rate\_alarm) | Create a CloudWatch alarm when Lambda error rate exceeds the configured percentage threshold | `bool` | `true` | no |
-| [enable\_lambda\_insights](#input\_enable\_lambda\_insights) | Enable the lambda insights layer, this must be disabled for lambda@edge usage | `bool` | `true` | no |
+| [enable\_lambda\_insights](#input\_enable\_lambda\_insights) | Enable the lambda insights layer, this must be disabled for lambda@edge usage | `bool` | `false` | no |
| [enable\_throttles\_alarm](#input\_enable\_throttles\_alarm) | Create a CloudWatch alarm when Lambda throttles exceed the configured threshold | `bool` | `true` | no |
| [enable\_xray\_tracing](#input\_enable\_xray\_tracing) | Enable AWS X-Ray active tracing for the Lambda function. | `bool` | `false` | no |
| [environment](#input\_environment) | The name of the tfscaffold environment | `string` | n/a | yes |
diff --git a/infrastructure/terraform/modules/lambda/lambda_function.tf b/infrastructure/terraform/modules/lambda/lambda_function.tf
index 9ec91d6..c480932 100644
--- a/infrastructure/terraform/modules/lambda/lambda_function.tf
+++ b/infrastructure/terraform/modules/lambda/lambda_function.tf
@@ -36,9 +36,7 @@ resource "aws_lambda_function" "main" {
layers = local.package_type == "zip" ? compact(concat(
var.layers,
- [
- var.enable_lambda_insights && var.lambda_at_edge == false ? "arn:aws:lambda:${var.region}:580247275435:layer:LambdaInsightsExtension:53" : null
- ]
+ [local.lambda_insights_layer_arn]
)) : []
environment {
diff --git a/infrastructure/terraform/modules/lambda/locals.tf b/infrastructure/terraform/modules/lambda/locals.tf
index bd112a0..73a5d55 100644
--- a/infrastructure/terraform/modules/lambda/locals.tf
+++ b/infrastructure/terraform/modules/lambda/locals.tf
@@ -3,6 +3,10 @@ locals {
package_type = lower(var.package_type)
+ lambda_insights_layer_arn = var.enable_lambda_insights && !var.lambda_at_edge ? (
+ var.architecture == "arm64" ? "arn:aws:lambda:${var.region}:580247275435:layer:LambdaInsightsExtension-Arm64:20" : "arn:aws:lambda:${var.region}:580247275435:layer:LambdaInsightsExtension:53"
+ ) : null
+
# Compound Scope Identifier
csi = replace(
format(
diff --git a/infrastructure/terraform/modules/lambda/variables.tf b/infrastructure/terraform/modules/lambda/variables.tf
index 89fad35..5687992 100644
--- a/infrastructure/terraform/modules/lambda/variables.tf
+++ b/infrastructure/terraform/modules/lambda/variables.tf
@@ -288,7 +288,7 @@ variable "system_log_level" {
variable "enable_lambda_insights" {
type = bool
description = "Enable the lambda insights layer, this must be disabled for lambda@edge usage"
- default = true
+ default = false
}
variable "enable_xray_tracing" {
diff --git a/scripts/config/vale/styles/config/vocabularies/words/accept.txt b/scripts/config/vale/styles/config/vocabularies/words/accept.txt
index 7ed3193..2cc7e52 100644
--- a/scripts/config/vale/styles/config/vocabularies/words/accept.txt
+++ b/scripts/config/vale/styles/config/vocabularies/words/accept.txt
@@ -1,7 +1,4 @@
[Bb]undler
-[Pp]npm
-[Rr]epo
-[Tt]erraform
Bitwarden
bot
Cognito
@@ -30,9 +27,11 @@ OAuth
Octokit
onboarding
Podman
+[Pp]npm
Python
rawContent
relative_url
+[Rr]epo
sed
simplifiable
sublicense
@@ -40,3 +39,4 @@ Syft
toolchain
Trivy
Trufflehog
+[Tt]erraform