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,043 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,440 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,440 points
1,774 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,440 points
1,346 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,440 points
9,983 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,440 points
6,730 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,045 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
3,439 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,440 points
12,495 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,440 points
2,431 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