Added layer, fixed add of content

This commit is contained in:
2024-05-01 12:00:48 +02:00
parent e149ab7c80
commit c2c268c0fd
4 changed files with 99 additions and 36 deletions

View File

@@ -150,6 +150,18 @@ data "archive_file" "lambda_standout_config_code" {
output_path = "./lambda_zip/standout_lambda_config.zip"
}
data "archive_file" "lambda_layer_deps" {
type = "zip"
source_dir = "./lambda_layer"
output_path = "./lambda_zip/lambda_layer.zip"
}
resource "aws_lambda_layer_version" "lambda_layer" {
filename = "./lambda_zip/lambda_layer.zip"
layer_name = "lambda_deps"
compatible_runtimes = ["python3.12"]
}
resource "aws_lambda_function" "lambda_standout_redirect" {
# If the file is not in the current working directory you will need to include a
# path.module in the filename.
@@ -162,6 +174,8 @@ resource "aws_lambda_function" "lambda_standout_redirect" {
runtime = "python3.12"
layers = [aws_lambda_layer_version.lambda_layer.arn]
timeout = 10
environment {
@@ -184,6 +198,8 @@ resource "aws_lambda_function" "lambda_standout_config" {
runtime = "python3.12"
layers = [aws_lambda_layer_version.lambda_layer.arn]
timeout = 10
environment {