How to import manually created s3 bucket in Terraform

0 votes

Hi Guys,

I have created an s3 bucket manually in AWS. Now I want to import this bucket to my Terraform state file. So that Terraform code can sync with the bucket. How can I do that?

Sep 11, 2020 in Terraform by akhtar
• 38,220 points
3,446 views

1 answer to this question.

0 votes

Hi@akhtar,

Terraform will not able to get the information that you created manually. So before running the Terraform code, you need to import the bucket information in the state file. You can use the below command to do so.

$ terraform import aws_s3_bucket.my-bucket bucket-created-manually
answered Sep 11, 2020 by MD
• 95,320 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,320 points
2,716 views
0 votes
1 answer

How to import module in Terraform code?

Hi@akhtar, A module is a container for multiple resources that ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,320 points
920 views
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,320 points
973 views
0 votes
1 answer
0 votes
1 answer

Why terraform is ignoring a manually created s3 bucket?

Hi@akhtar, Terraform is a declarative language, you can ...READ MORE

answered Sep 11, 2020 in Terraform by akhtar
• 38,220 points
267 views
0 votes
1 answer
0 votes
1 answer

How to create a folder in S3 bucket using terraform?

Hi@akhtar, You can use aws_s3_bucket_object resource to create one ...READ MORE

answered Jun 11, 2020 in Terraform by MD
• 95,320 points
4,287 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,320 points
423 views