Skip to content

feat: Support FIPS-compliant extension layer #30

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ locals {
x86_64 = "",
arm64 = "-ARM"
}
fips_suffix = local.is_fips_enabled ? "-FIPS" : ""
runtime_base = regex("[a-z]+", var.runtime)
runtime_base_environment_variable_map = {
dotnet = {
Expand Down Expand Up @@ -51,11 +52,16 @@ locals {
"python3.12" = "Datadog-Python312"
"python3.13" = "Datadog-Python313"
}
is_fips_enabled = (
var.datadog_is_fips_enabled != null
? var.datadog_is_fips_enabled
: (lookup(var.environment_variables, "DD_SITE", "") == "ddog-gov.com")
)
}

locals {
datadog_extension_layer_arn = "${local.datadog_layer_name_base}:Datadog-Extension${local.datadog_extension_layer_suffix}:${var.datadog_extension_layer_version}"
datadog_extension_layer_suffix = local.datadog_layer_suffix
datadog_extension_layer_suffix = "${local.datadog_layer_suffix}${local.fips_suffix}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are we using the existing "datadog_layer_suffix" bit for? can we reuse it for fips?

Copy link
Author

@ShepleySound ShepleySound Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's a lookup on the architectures variable and determines the suffix for both the layer for the Datadog Lambda Library and the layer for the Lambda Extension.

From what I've gathered from the docs, the Extension has FIPS-compatible layers, but the Lambda Library does not. So the suffixes are related, but do actually need to be different in this case.


datadog_lambda_layer_arn = "${local.datadog_layer_name_base}:${local.datadog_lambda_layer_runtime}${local.datadog_lambda_layer_suffix}:${local.datadog_lambda_layer_version}"
datadog_lambda_layer_suffix = contains(["java", "nodejs"], local.runtime_base) ? "" : local.datadog_layer_suffix # java and nodejs don't have separate layers for ARM
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ variable "datadog_python_layer_version" {
default = 106
}

variable "datadog_is_fips_enabled" {
description = "When set to true, a FIPS-compliant Lambda extension layer is used. Defaults to `true` if the DD_SITE environment variable is ddog-gov.com. Otherwise, defaults to `false`."
type = bool
default = null
}


###################
# Lambda Function
Expand Down