Skip to content

Commit

Permalink
Merge pull request #844 from asfadmin/rew/terraform-s3-object-hash
Browse files Browse the repository at this point in the history
Fix Terraform updating dependency layer object when content hasn't changed
  • Loading branch information
reweeden authored Oct 4, 2024
2 parents 027b0c8 + 3eb4866 commit 66d96f7
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,27 @@ 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)
tags = var.tags
}

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)
tags = var.tags
}

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)
tags = var.tags
}

resource "aws_cloudformation_stack" "thin_egress_app" {
Expand Down

0 comments on commit 66d96f7

Please sign in to comment.