How to import module in Terraform code

0 votes

Hi Guys,

I have one Terraform code. In this code, I want to import one module from another file. How can I do that?

Jul 21, 2020 in Terraform by akhtar
• 38,260 points
2,132 views

1 answer to this question.

0 votes

Hi@akhtar,

A module is a container for multiple resources that are used together. Every Terraform configuration has at least one module, known as its root module, which consists of the resources defined in the .tf files in the main working directory. To call a module means to include the contents of that module into the configuration with specific values for its input variables. Modules are called from within other modules using module blocks.

module "servers" {
  source = "./app-cluster"
}
answered Jul 21, 2020 by MD
• 95,460 points

Related Questions In Terraform

0 votes
1 answer

How to add a route for IGW in AWS using Terraform code?

Hi@akhtar, Terraform has one keyword named route. It allows ...READ MORE

answered Jul 22, 2020 in Terraform by MD
• 95,460 points
4,525 views
0 votes
1 answer

How to create an EFS in AWS from Terraform Code?

Hi@MD, You can use aws_efs_file_system resource in Terraform. ...READ MORE

answered Sep 9, 2020 in Terraform by akhtar
• 38,260 points
1,366 views
0 votes
1 answer

How to import manually created s3 bucket in Terraform?

Hi@akhtar, Terraform will not able to get the ...READ MORE

answered Sep 11, 2020 in Terraform by MD
• 95,460 points
12,671 views
0 votes
1 answer

How to create a VPC in GCP Cloud using Terraform code?

Hi@akhtar, You can create your own VPC in ...READ MORE

answered Sep 13, 2020 in Terraform by MD
• 95,460 points
1,650 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
+2 votes
1 answer
0 votes
1 answer

How to create a route table in AWS using Terraform code?

Hi@akhtar, You can use aws_route_table resources in your ...READ MORE

answered Jul 21, 2020 in Terraform by MD
• 95,460 points
5,829 views
0 votes
1 answer

How to attach Elastic IP in EC2 instance using Terraform code?

Hi@akhtar, You can use aws_eip resource in your ...READ MORE

answered Jul 22, 2020 in Terraform by MD
• 95,460 points
8,577 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