Skip to content

Commit 94afced

Browse files
authored
Merge pull request #2854 from posiposi/migrating_go1.x_to_custom_runtime_eventbridge_to_lambda
eventbridge-schedule-to-lambda-terraform-go: Migrate runtime from go1.x to Amazon Linux 2023
2 parents cf87808 + fdfb07d commit 94afced

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

eventbridge-schedule-to-lambda-terraform-go/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ Important: this application uses various AWS services and there are costs associ
3434
```
3535
1. Compile the main.go file to create an executable:
3636
```
37-
GOOS=linux GOARCH=amd64 go build -o main main.go
37+
GOOS=linux GOARCH=amd64 go build -o bootstrap main.go
3838
```
3939
1. Create a zip file with the Go executable file:
4040
```
41-
zip main.zip main
41+
zip myFunction.zip bootstrap
4242
```
4343
1. Change directory back into the pattern directory:
4444
```
@@ -74,4 +74,4 @@ After deployment, you can verify the schedule is invoking the Lambda function by
7474
----
7575
Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
7676
77-
SPDX-License-Identifier: MIT-0
77+
SPDX-License-Identifier: MIT-0

eventbridge-schedule-to-lambda-terraform-go/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ data "aws_caller_identity" "current" {}
1515

1616
data "archive_file" "LambdaZipFile" {
1717
type = "zip"
18-
source_file = "${path.module}/src/main"
18+
source_file = "${path.module}/src/bootstrap"
1919
output_path = "${path.module}/eventbridge_go_function.zip"
2020
}
2121

2222
resource "aws_lambda_function" "eventbridge_function" {
2323
function_name = "EventBridgeScheduleTarget"
2424
filename = data.archive_file.LambdaZipFile.output_path
25-
handler = "main"
25+
handler = "bootstrap"
2626
role = aws_iam_role.iam_for_lambda.arn
27-
runtime = "go1.x"
27+
runtime = "provided.al2023"
2828
memory_size = 128
2929
timeout = 30
3030
}

0 commit comments

Comments
 (0)