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,230 points
12,251 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,440 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,440 points
3,688 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,440 points
1,870 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,440 points
2,668 views
0 votes
1 answer

How to block public access to S3 bucket using Terraform?

Hi@akhtar, To control the access of the S3 ...READ MORE

answered Sep 9, 2020 in Terraform by MD
• 95,440 points
13,290 views
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,230 points
1,195 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,440 points
10,104 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,440 points
1,003 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP