From 1971902996c319d141cd6fec203ef123d1776a6c Mon Sep 17 00:00:00 2001 From: Rohan Weeden Date: Thu, 3 Oct 2024 10:47:30 -0400 Subject: [PATCH] Replace etag with source_hash This avoids the etag behavior for multipart uploads from forcing an object update even when the source hasn't changed. --- terraform/main.tf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/terraform/main.tf b/terraform/main.tf index f181c3f5..842e3467 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -23,24 +23,24 @@ resource "aws_s3_bucket" "lambda_source" { } resource "aws_s3_object" "lambda_source" { - bucket = aws_s3_bucket.lambda_source.bucket - key = "${filemd5(local.lambda_source_filename)}.zip" - source = local.lambda_source_filename - etag = filemd5(local.lambda_source_filename) + bucket = aws_s3_bucket.lambda_source.bucket + key = "${filemd5(local.lambda_source_filename)}.zip" + source = local.lambda_source_filename + source_hash = filemd5(local.lambda_source_filename) } resource "aws_s3_object" "lambda_code_dependency_archive" { - bucket = aws_s3_bucket.lambda_source.bucket - key = "${filemd5(local.dependency_layer_filename)}.zip" - source = local.dependency_layer_filename - etag = filemd5(local.dependency_layer_filename) + bucket = aws_s3_bucket.lambda_source.bucket + key = "${filemd5(local.dependency_layer_filename)}.zip" + source = local.dependency_layer_filename + source_hash = filemd5(local.dependency_layer_filename) } resource "aws_s3_object" "cloudformation_template" { - bucket = aws_s3_bucket.lambda_source.bucket - key = "${filemd5(local.cloudformation_template_filename)}.yaml" - source = local.cloudformation_template_filename - etag = filemd5(local.cloudformation_template_filename) + bucket = aws_s3_bucket.lambda_source.bucket + key = "${filemd5(local.cloudformation_template_filename)}.yaml" + source = local.cloudformation_template_filename + source_hash = filemd5(local.cloudformation_template_filename) } resource "aws_cloudformation_stack" "thin_egress_app" {