How to create a folder in S3 bucket using terraform

0 votes

Hi Guys,

I want to create one folder using terraform. Can anyone help me how can I create one folder in s3 bucket?

Jun 11, 2020 in Terraform by akhtar
• 38,180 points
2,934 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use aws_s3_bucket_object resource to create one folder in s3. I have attached one example below.

resource "aws_s3_bucket_object" "folder1" {
    bucket = "aws_s3_bucket"
    acl    = "public"
    key    = "Folder1/"
    source = "/dev/null"
}

I hope this will help.

answered Jun 11, 2020 by MD
• 95,140 points

Related Questions In Terraform

0 votes
1 answer

How to create one s3 bucket using terraform?

Hi@akhtar, You can use aws_s3_bucket resources to create ...READ MORE

answered Jun 12, 2020 in Terraform by MD
• 95,140 points
2,187 views
0 votes
1 answer

How to create a namespace in minikube using Terraform?

Hi@akhtar, You can use kubernetes_namespace resource. It is used ...READ MORE

answered Jun 30, 2020 in Terraform by MD
• 95,140 points
598 views
0 votes
1 answer

How to create a rds snapshot from running rds instance in AWS using terraform?

Hi, I think you can use aws_db_instance resource to ...READ MORE

answered Jul 20, 2020 in Terraform by MD
• 95,140 points
913 views
0 votes
1 answer

How to create a VPC in AWS using Terraform?

Hi@akhtar, You can find the script in the ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,140 points
317 views
0 votes
1 answer
0 votes
1 answer

How to create a folder inside S3 Bucket using Terraform code?

Hi@akhtar, You can create a folder at the ...READ MORE

answered Jul 23, 2020 in Terraform by MD
• 95,140 points
598 views
0 votes
1 answer

How to create one S3 bucket in AWS using Terraform?

Hi@akhtar, You need to set aws provider name ...READ MORE

answered Jul 23, 2020 in Terraform by MD
• 95,140 points
294 views