Right now I have the following in my main.tf:
resource "aws_lambda_function" "terraform_lambda" {
filename = "tf_lambda.zip"
function_name = "tf_lambda"
role = "lambda_basic_execution"
handler = "tf_lambda.lambda_handler"
source_code_hash = "${base64sha256(file("tf_lambda.zip"))}"
runtime = "python3.6"
}
My directory structure is like so:
.
|-- main.tf
|-- tf_lambda.zip
|-- tf_lambda
└── tf_lambda.py
When I run terraform apply and then, in the console, go to the lambda created the code section is empty and it invites me to upload a zip file. How do I make sure the code actually gets uploaded?