Skip to content
This repository was archived by the owner on Jun 10, 2025. It is now read-only.

A Terraform module that creates deterministic .zip archives with consistent checksums across Linux/Windows platforms using Python. Ideal for AWS Lambda deployments.

Notifications You must be signed in to change notification settings

JayDoubleu/terraform-external-archive-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-archive-python

Note: This repository has been archived. It was created to accommodate the consistent creation of Lambda zips when using multiple operating systems. The Terraform Go module for archiving was producing different checksums depending on the operating system it was executed on, resulting in false zip changes when running terraform apply. This module ensured that the zip file always had consistent checksums regardless of the operating system used. This repository is now archived as it's likely that the issue has been fixed in the source Terraform Go module.

Python based terraform module to create the same .zip file across operating systems.

Tested against python2/3 linux/windows.

Should resolve issues with:

  • Different operating systems producing diffrent checksums
  • No longer have to touch/create .zip file before running terraform
module "archive_lambda" {
    source = "./"
    source_dir = "dummy_lambda/"
    output_path = "dummy_lambda.zip"
}


resource "aws_lambda_function" "lambda_function" {
  filename         = "${module.archive_lambda.zip_path}"
  source_code_hash = "${module.archive_lambda.base64sha256}"
}

About

A Terraform module that creates deterministic .zip archives with consistent checksums across Linux/Windows platforms using Python. Ideal for AWS Lambda deployments.

Resources

Stars

Watchers

Forks