I have a Terraform set up that creates an s3 bucket and sub directories in the bucket. For some reason the bucket is created with an empty / and in each directory.
s3_bucket:
-/
-folder1:-/
-some file
-folder2:-/
And so on for every directory, there is an empty /. This causes issues in my next few steps, why is it created this way? how can I create the s3 and folders without the empty / ?
resource "aws_s3_bucket_object" "object" {
bucket = "${aws_s3_bucket.s3_ob.id}"
key = "folder1/"
source = "dummy.txt"
}
resource "aws_s3_bucket_object" "object2" {
bucket = "${aws_s3_bucket.s3_ob.id}"
key = "/folder2/"
source = "dummy.txt"
}