Skip to content

Commit

Permalink
readded reg arch
Browse files Browse the repository at this point in the history
  • Loading branch information
aahel committed Feb 26, 2024
1 parent 0dfe99b commit e03bf80
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/lambda-registrator/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ resource "aws_lambda_function" "registration" {
image_uri = var.enable_auto_publish_ecr_image ? local.generated_ecr_image_uri : var.ecr_image_uri
package_type = "Image"
function_name = var.name
architectures = var.arch
role = aws_iam_role.registration.arn
timeout = var.timeout
reserved_concurrent_executions = var.reserved_concurrent_executions
Expand Down
11 changes: 11 additions & 0 deletions modules/lambda-registrator/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,14 @@ variable "enable_auto_publish_ecr_image" {
type = bool
default = false
}

variable "arch" {
type = string
default = "x86_64"
description = "Lambda Architecture. Valid values are arm64 and x86_64"

validation {
condition = can(regex("^(arm64|x86_64)$", var.arch))
error_message = "Invalid value for 'arch', options: 'arm64', 'x86_64'."
}
}
1 change: 1 addition & 0 deletions test/acceptance/tests/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func TestBasic(t *testing.T) {
}
tfVars := config.TFVars()
tfVars["secure"] = c.secure
tfVars["arch"] = config.Arch
namespace := ""
partition := ""
queryString := ""
Expand Down
1 change: 1 addition & 0 deletions test/acceptance/tests/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ module "lambda-registration" {
enable_auto_publish_ecr_image = var.enable_auto_publish_ecr_image
consul_extension_data_prefix = "/${var.suffix}"
private_ecr_repo_name = var.private_ecr_repo_name
arch = var.arch == "arm64" ? "arm64" : "x86_64"
}
6 changes: 6 additions & 0 deletions test/acceptance/tests/setup/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,9 @@ variable "private_ecr_repo_name" {
type = string
default = ""
}

variable "arch" {
type = string
default = "x86_64"
description = "Lambda Architecture"
}

0 comments on commit e03bf80

Please sign in to comment.