Created
March 21, 2023 17:00
-
-
Save hendrixroa/347f61e79ec16dfd39468e17aea5649e to your computer and use it in GitHub Desktop.
S3 object loop to iterate over a folder to upload all files from a folder directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_s3_object" "storage" { | |
for_each = fileset("${var.path_files}/", "*") | |
bucket = aws_s3_bucket.storage_bucket.id | |
key = each.value | |
source = "${var.path_files}/${each.value}" | |
etag = filemd5("${var.path_files}/${each.value}") | |
acl = "public-read" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment