Skip to content

Commit

Permalink
update provided.al2 runtime and the new binary format
Browse files Browse the repository at this point in the history
  • Loading branch information
brookesargent committed Oct 13, 2023
1 parent 4d8a20f commit 755b643
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
5 changes: 3 additions & 2 deletions modules/rds-logs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ module "rds_lambda_transform" {
function_name = "${var.name}-honeycomb-rds-${var.db_engine}-log-parser"
description = "Parses RDS logs coming off of Kinesis Firehose, sending them back to the Firehose as structured JSON events."
handler = "rds-${var.db_engine}-kfh-transform"
runtime = "go1.x"
runtime = "provided.al2"
architectures = var.lambda_function_architecture == "amd64" ? ["x86_64"] : ["arm64"]
memory_size = var.lambda_function_memory
timeout = var.lambda_function_timeout

create_package = false
s3_existing_package = {
bucket = coalesce(var.lambda_package_bucket, "honeycomb-integrations-${data.aws_region.current.name}")
key = coalesce(var.lambda_package_key, "agentless-integrations-for-aws/LATEST/ingest-handlers.zip")
key = coalesce(var.lambda_package_key, "agentless-integrations-for-aws/${var.agentless_integrations_version}/rds-${var.db_engine}-kfh-transform-${var.lambda_function_architecture}.zip")
}

attach_policy = true
Expand Down
22 changes: 22 additions & 0 deletions modules/rds-logs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ variable "http_buffering_interval" {
description = "Kinesis Firehose http buffer interval, in seconds."
}

variable "lambda_function_architecture" {
type = string
default = "arm64"
description = "Instruction set architecture for your Lambda function."
validation {
condition = contains(["amd64", "arm64"],
var.lambda_function_architecture)
error_message = "Not an allowed Lambda architecture."
}
}

variable "lambda_function_memory" {
type = number
default = 192
Expand Down Expand Up @@ -162,3 +173,14 @@ variable "tags" {
description = "Tags to add to resources created by this module."
default = null
}

variable "agentless_integrations_version" {
type = string
description = "Version of https://github.com/honeycombio/agentless-integrations-for-aws to use. Default is LATEST, but note that specifying this does not automatically update the lambda to use the newest versions as they are released."
default = "LATEST"

validation {
error_message = "Version must be at least 4.0.0"
condition = can(regex("^([4-9]|[1-9][0-9]+)\.[0-9]+\.[0-9]+$", var.agentless_integrations_version))
}
}
5 changes: 3 additions & 2 deletions modules/s3-logfile/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ module "s3_processor" {
function_name = var.name
description = "Parses LB access logs from S3, sending them to Honeycomb as structured events"
handler = "s3-handler"
runtime = "go1.x"
runtime = "provided.al2"
architectures = var.lambda_function_architecture == "amd64" ? ["x86_64"] : ["arm64"]
memory_size = var.lambda_function_memory
timeout = var.lambda_function_timeout

create_package = false
s3_existing_package = {
bucket = coalesce(var.lambda_package_bucket, "honeycomb-integrations-${data.aws_region.current.name}")
key = coalesce(var.lambda_package_key, "agentless-integrations-for-aws/${var.agentless_integrations_version}/ingest-handlers.zip")
key = coalesce(var.lambda_package_key, "agentless-integrations-for-aws/${var.agentless_integrations_version}/s3-handler-${var.lambda_function_architecture}.zip")
}


Expand Down
16 changes: 16 additions & 0 deletions modules/s3-logfile/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ variable "kms_key_arn" {
default = ""
}

variable "lambda_function_architecture" {
type = string
default = "arm64"
description = "Instruction set architecture for your Lambda function."
validation {
condition = contains(["amd64", "arm64"],
var.lambda_function_architecture)
error_message = "Not an allowed Lambda architecture."
}
}

variable "lambda_function_memory" {
type = number
default = 192
Expand Down Expand Up @@ -136,4 +147,9 @@ variable "agentless_integrations_version" {
type = string
description = "Version of https://github.com/honeycombio/agentless-integrations-for-aws to use. Default is LATEST, but note that specifying this does not automatically update the lambda to use the newest versions as they are released."
default = "LATEST"

validation {
error_message = "Version must be at least 4.0.0"
condition = can(regex("^([4-9]|[1-9][0-9]+)\.[0-9]+\.[0-9]+$", var.agentless_integrations_version))
}
}

0 comments on commit 755b643

Please sign in to comment.