Skip to content

Instantly share code, notes, and snippets.

@iamtheindian
Created June 13, 2020 11:54
Show Gist options
  • Save iamtheindian/9fb89379fce08a9ed601c4591672cdfd to your computer and use it in GitHub Desktop.
Save iamtheindian/9fb89379fce08a9ed601c4591672cdfd to your computer and use it in GitHub Desktop.
#variables and data
data "local_file" "pathfi" {
filename = "/root/HybridCloud/Terraform/img/path.txt"
}
/////////////////////////////////////////////////////
#buckets
resource "aws_s3_bucket" "b" {
bucket = "aws-terraform-bucket-rahul3"
acl = "private"
force_destroy = true
tags = {
Name = "My bucket1"
Environment = "Dev1"
}
versioning {
enabled = false
}
provisioner "local-exec" {
command = "aws s3 sync ${data.local_file.pathfi.content} s3://${aws_s3_bucket.b.id} --profile rbterra "
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment