Manually zipping files is prone to error. The HashiCorp Archive Provider is the industry-standard way to automate the creation of handler.zip within a CI/CD pipeline.
In the context of Infrastructure as Code (IaC) and cloud deployments, typically refers to the deployment package for a serverless function, most commonly an AWS Lambda function . [handler].zip
: You can point the aws_lambda_function resource in Terraform directly to the output_path of the archive_file data source. Manually zipping files is prone to error
: The entry point file containing the function (e.g., def lambda_handler(event, context): ). [handler].zip
data "archive_file" "lambda_zip" { type = "zip" source_file = "${path.module}/src/handler.py" output_path = "${path.module}/dist/handler.zip" } Use code with caution. Copied to clipboard : Points to your raw script (e.g., src/handler.py ).