Skip to content

Commit

Permalink
Add source_hash for the tfvars S3 objects (#29)
Browse files Browse the repository at this point in the history
* Ensures the file will be updated when changed
  • Loading branch information
Stretch96 authored Oct 18, 2023
1 parent 273d629 commit 2779632
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions s3-tfvars-files.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
resource "aws_s3_object" "tfvar_file" {
for_each = local.tfvars_files

bucket = aws_s3_bucket.tfvars.id
key = each.value["key"] == "" ? each.value["path"] : each.value["key"]
source = each.value["path"]
kms_key_id = local.tfvars_kms_encryption ? aws_kms_key.tfvars[0].arn : null
bucket = aws_s3_bucket.tfvars.id
key = each.value["key"] == "" ? each.value["path"] : each.value["key"]
source = each.value["path"]
source_hash = filemd5(each.value["path"])
kms_key_id = local.tfvars_kms_encryption ? aws_kms_key.tfvars[0].arn : null
}

0 comments on commit 2779632

Please sign in to comment.