0

I am using terraform to create lambda function and already have zip package in S3:

{
  RespMetadata: {
    StatusCode: 400,
    RequestID: "fa9b0e8b-02a6-4eaf-81ae-bf30fc6a1153"
  },
  Message_: "Could not unzip uploaded file. Please check your file, then try to upload again.",
  Type: "User"
}

My code looks as below:

resource "aws_lambda_function" "test_lambda" {
  s3_bucket = "bucket_name"
  s3_key = "lambda.zip"
  function_name = "Function_Test"
  role = aws_iam_role.test_lambda_role.arn
  handler = "config.lambda_handler"
  runtime = "python3.8"
  timeout = 180
  vpc_config {
    subnet_ids = ["subnet-123"]
    security_group_ids = ["sg-123"]
  }

environment { variables = { LOG_LEVEL = "DEBUG" host = "https://abc:9098" } } }

0 Answers0