Skip to content

Commit ec49605

Browse files
fix: Go 1.x runtime is deprecated
1 parent 1af5cea commit ec49605

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ No modules.
7373
| <a name="input_lambda_envvars"></a> [lambda\_envvars](#input\_lambda\_envvars) | Environment variables | `map(any)` | `{}` | no |
7474
| <a name="input_lambda_iam_role_arn"></a> [lambda\_iam\_role\_arn](#input\_lambda\_iam\_role\_arn) | ARN of IAM role to use for Lambda | `string` | `""` | no |
7575
| <a name="input_lambda_s3_custom_rules"></a> [lambda\_s3\_custom\_rules](#input\_lambda\_s3\_custom\_rules) | List of rules to evaluate how to upload a given S3 object to Observe | <pre>list(object({<br> pattern = string<br> headers = map(string)<br> }))</pre> | `[]` | no |
76-
| <a name="input_lambda_version"></a> [lambda\_version](#input\_lambda\_version) | Version of lambda binary to use | `string` | `"latest"` | no |
76+
| <a name="input_lambda_version"></a> [lambda\_version](#input\_lambda\_version) | Version of lambda binary to use | `string` | `"arm64/latest"` | no |
7777
| <a name="input_memory_size"></a> [memory\_size](#input\_memory\_size) | The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation.<br>The default value is 128 MB. The value must be a multiple of 64 MB. | `number` | `128` | no |
7878
| <a name="input_name"></a> [name](#input\_name) | Name of Lambda resource | `string` | n/a | yes |
7979
| <a name="input_observe_collection_endpoint"></a> [observe\_collection\_endpoint](#input\_observe\_collection\_endpoint) | Observe Collection Endpoint, e.g https://123456789012.collect.observeinc.com | `string` | `null` | no |

main.tf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ locals {
33
lambda_iam_role_arn = var.lambda_iam_role_arn != "" ? var.lambda_iam_role_arn : aws_iam_role.lambda[0].arn
44
lambda_iam_role_name = regex(".*role/(?P<role_name>.*)$", local.lambda_iam_role_arn)["role_name"]
55
s3_bucket = var.s3_bucket != "" ? var.s3_bucket : lookup(var.s3_regional_buckets, data.aws_region.current.name, local.default_lambda_bucket)
6-
s3_key = var.s3_key != "" ? var.s3_key : join("/", [var.s3_key_prefix, format("%s.zip", var.lambda_version)])
6+
s3_key = var.s3_key != "" ? var.s3_key : (
7+
strcontains(var.lambda_version, "/") ?
8+
join("/", [var.s3_key_prefix, format("%s.zip", var.lambda_version)]) :
9+
format("lambda/observer/arm64/%s.zip", var.lambda_version)
10+
)
711

812
goarch = lookup(
913
{
@@ -20,9 +24,9 @@ locals {
2024
},
2125
split("/", var.lambda_version)[0],
2226
{
23-
architectures = null
24-
handler = "main"
25-
runtime = "go1.x"
27+
architectures = ["arm64"]
28+
handler = "bootstrap"
29+
runtime = "provided.al2"
2630
},
2731
)
2832
}

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ variable "observe_domain" {
3939
variable "lambda_version" {
4040
description = "Version of lambda binary to use"
4141
type = string
42-
default = "latest"
42+
default = "arm64/latest"
4343
nullable = false
4444
}
4545

0 commit comments

Comments
 (0)