How to read data from a file in Terraform

0 votes

Hi Guys,

I have one CSV file. I want to read data from this file using Terraform. How can I do that?

Jul 27, 2020 in Terraform by akhtar
• 38,170 points
954 views

1 answer to this question.

0 votes

Hi@akhtar,

You can use the file function in Terraform. This file function reads the contents of a file at the given path and returns them as a string. You can go through the below document for more information.

https://www.terraform.io/docs/configuration/functions/file.html

answered Jul 27, 2020 by MD
• 95,060 points

Related Questions In Terraform

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,060 points
2,477 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,060 points
536 views
0 votes
1 answer

How to create a variable in Terraform?

Hi@akhtar, Terraform has an inbuilt variable keyword to ...READ MORE

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

'terraform' is not recognized as an internal or external command, operable program or batch file.

Hi@akhtar, You have to set an environment variable ...READ MORE

answered Jun 10, 2020 in Terraform by MD
• 95,060 points
2,415 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,060 points
559 views
0 votes
1 answer

What is a Terraform provider?

Hi@akhtar, Terraform is agnostic to the underlying cloud ...READ MORE

answered Jul 23, 2020 in Terraform by MD
• 95,060 points
126 views
+2 votes
1 answer

How to create a workspace in terraform?

Hi@MD, Terraform has a command named terraform workspace. ...READ MORE

answered Aug 16, 2020 in Terraform by akhtar
• 38,170 points
157 views
0 votes
1 answer

How to read input from CSV file or any file instead of using tfvars file in Terraform?

Hi, You can use the file function in Terraform. ...READ MORE

answered Jul 27, 2020 in Terraform by MD
• 95,060 points
519 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,060 points
782 views