How to create a variable in Terraform

0 votes

Hi Guys,

I have one Terraform script that will create one ec2 instance. I want to create one variable in this script so that I can change the blue dynamically. How can I do that?

Jul 21, 2020 in Terraform by akhtar
• 38,170 points
134 views

1 answer to this question.

0 votes

Hi@akhtar,

Terraform has an inbuilt variable keyword to create one variable. You can see the below code block.

variable "image_id" {
    default="t2.micro"
}
answered Jul 21, 2020 by MD
• 95,040 points

Related Questions In Terraform

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,040 points
810 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,040 points
270 views
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,040 points
765 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
162 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
964 views
+2 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,040 points
2,538 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,040 points
549 views