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

0 votes
HI,

How to read input variables from a CSV file or any file instead of using the TFVARS file. Is this possible to do? What are the steps should I follow if this possible.
Jul 24, 2020 in Terraform by Lakshminarayanan
• 1,370 points

recategorized Jul 27, 2020 by MD 5,795 views
Hi,

I have the similar requirement.

How did you go about implementing this
Hi@Mahak,

You can go through the below link. You will get the idea.

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

1 answer to this question.

0 votes

Hi,

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,460 points

Related Questions In Terraform

0 votes
1 answer

How to read the volume ID of the EC2 instance using Terraform?

Hi@akhtar, You won't be able to extract EBS ...READ MORE

answered Dec 4, 2020 in Terraform by MD
• 95,460 points
2,300 views
0 votes
1 answer

How to create one key in AWS using terraform?

Hi@akhtar, You can use aws_key_pair resource n terraform. ...READ MORE

answered Jun 11, 2020 in Terraform by MD
• 95,460 points
1,557 views
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,460 points
10,965 views
0 votes
1 answer

How to do ssh in EC2 instance using Terraform?

Hi@akhtar, To ssh in your EC2 instance, you ...READ MORE

answered Jun 15, 2020 in Terraform by MD
• 95,460 points
7,195 views
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
3,925 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
0 votes
1 answer

How to read data from a file in Terraform?

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

answered Jul 27, 2020 in Terraform by MD
• 95,460 points
13,481 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,460 points
2,665 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