Skip to content

feat: select runtime / arch based off version #66

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

Merged
merged 1 commit into from
Jun 22, 2023
Merged

feat: select runtime / arch based off version #66

merged 1 commit into from
Jun 22, 2023

Conversation

jta
Copy link

@jta jta commented Jun 22, 2023

We provide newer builds that can run on provided.al2 for different architectures. These builds are under a GOARCH directory (e.g. arm64/latest). This commit identifies what runtime, handler and architecture to use based off of the version string.

Will defer switching the default for lambda_version to a future release.

@jta jta requested review from bendrucker and aping1 as code owners June 22, 2023 17:06
@jta jta requested a review from obs-gh-irismcleary June 22, 2023 17:06
main.tf Outdated
@@ -4,6 +4,26 @@ locals {
lambda_iam_role_name = regex(".*role/(?P<role_name>.*)$", local.lambda_iam_role_arn)["role_name"]
s3_bucket = var.s3_bucket != "" ? var.s3_bucket : lookup(var.s3_regional_buckets, data.aws_region.current.name, local.default_lambda_bucket)
s3_key = var.s3_key != "" ? var.s3_key : join("/", [var.s3_key_prefix, format("%s.zip", var.lambda_version)])

goarch = lookup({

Choose a reason for hiding this comment

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

okay so, logicking through the lookup() and current default lambda_version ("latest"), this will always fall through to the default go1.x unless we explicitly override lambda_version. sgtm

@jta jta force-pushed the joao/arch-bis branch from 283ed6c to ab3c13f Compare June 22, 2023 17:26
Copy link
Contributor

@bendrucker bendrucker left a comment

Choose a reason for hiding this comment

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

There's a syntax error here

@bendrucker
Copy link
Contributor

Actually no just weird indentation

@jta
Copy link
Author

jta commented Jun 22, 2023

There's a syntax error here

I was really surprised by the result of terraform fmt there, but can't figure out how to make it do the right thing :/

Edit: the trick was not having the opening { on the same line as lookup(

We provide newer builds that can run on `provided.al2` for different
architectures. These builds are under a GOARCH directory (e.g.
`arm64/latest`). This commit identifies what runtime, handler and
architecture to use based off of the version string.

Will defer switching the default for `lambda_version` to a future
release.
@jta jta force-pushed the joao/arch-bis branch from ab3c13f to f0d2585 Compare June 22, 2023 17:55
@jta jta merged commit edac772 into main Jun 22, 2023
@jta jta deleted the joao/arch-bis branch September 5, 2023 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants