[TF] Update AWS and required TF versions, support al2 images for Lambdas, and arm64 Lambda support#40
Conversation
| VERSION := $(shell git describe --tags --always) | ||
| DOCS_DIR ?= ./docs | ||
| DEPLOYMENT_ZIP_PATH = $(PWD)/build/package/deployment.zip | ||
| RUDOLPH_API_DEPLOYMENT_ZIP_PATH = $(PWD)/build/package/api_deployment.zip |
There was a problem hiding this comment.
since each zip now needs to contain a singular binary called bootstrap this is required to split each handler into its own zip...
| provider "aws" { | ||
| region = "us-east-1" | ||
| default_tags { | ||
| tags = { |
There was a problem hiding this comment.
Updated the README doc from the previous PR #39
| lambda_zip = var.zip_file_path | ||
| package_version = var.package_version | ||
|
|
||
| lambda_api_zip = var.lambda_api_zip |
There was a problem hiding this comment.
provide each zip folder location now
| } | ||
|
|
||
| variable "lambda_zip" { | ||
| variable "lambda_api_zip" { |
There was a problem hiding this comment.
TF vars for zip locations
| etag = filemd5(var.lambda_api_zip) | ||
| } | ||
|
|
||
| resource "aws_s3_bucket_object" "santa_api_authorizer_source" { |
There was a problem hiding this comment.
add the authorizer as a separate s3 bucket object
| lambda_source_bucket = aws_s3_bucket_object.santa_api_source.bucket | ||
| lambda_source_key = aws_s3_bucket_object.santa_api_source.key | ||
| lambda_source_hash = local.lambda_source_hash | ||
| lambda_handler = "api" |
There was a problem hiding this comment.
since handlers for al2.provided images must just be called bootstrap this var is no longer needed
|
|
||
| # Use the authorizer's UsageIdentifierKey to uniquely identify an endpoint. | ||
| api_key_source = "AUTHORIZER" | ||
|
|
There was a problem hiding this comment.
remove commented code
| type = string | ||
| description = "Lambda function handler path. If left blank, this will default to a formatted handler based on the endpoint variable value" | ||
| default = "" | ||
| default = "bootstrap" |
There was a problem hiding this comment.
al2.provided requires that the executing binary be called bootstrap to execute properly
| locals { | ||
| handler = var.lambda_handler == "" ? var.endpoint : var.lambda_handler | ||
| handler = "bootstrap" | ||
| runtime = "provided.al2" |
| CLI_NAME=rudolph | ||
| PKG_DIR=$BUILD_DIR/package | ||
| DEPLOYMENT_ZIP_PATH=$PKG_DIR/deployment.zip | ||
| API_DEPLOYMENT_ZIP_PATH=$PKG_DIR/api_deployment.zip |
There was a problem hiding this comment.
update the build scripts to reflect to lambda handler output zips being created:
- API handler
- API authorizer handler
| function_name = "${var.prefix}_rudolph_${var.endpoint}" | ||
| role = aws_iam_role.api_handler_role.arn | ||
| handler = local.handler | ||
| runtime = "go1.x" |
|
Should cut a new release for this, maybe 0.2.0 or something. The deprecation of |
to: @airbnb/rudolph-maintainers
Background
This PR seeks to adopt the changes as AWS is seeking to deprecate al1 backed Lambdas by end of year 2023...ref: https://aws.amazon.com/blogs/compute/migrating-aws-lambda-functions-from-the-go1-x-runtime-to-the-custom-runtime-on-amazon-linux-2/.
Changes
provided.al2lambda images for running custom binaries like compiled golang binariesTesting
Deployed to personal development AWS account: