Dipendra Dangal
Dipendra Dangal

Reputation: 1183

Customizing Terraform Input

I have to take 7 inputs from the user in Terraform. Each time when i take input, it shows "Enter a value", which will give user a little confusion.

enter image description here

Can i change "Enter a Value" to my custom like "Enter AWS Region" and so on?

Upvotes: 0

Views: 158

Answers (2)

victor m
victor m

Reputation: 2175

You can add a bash wrapper around terraform using bash and define a few TF_VAR_name variables before you call the terraform command.

Upvotes: 1

Shiv Rajawat
Shiv Rajawat

Reputation: 988

Use an argument "description" inside your variable declaration block. It is used to give a human-friendly description for that variable which is primarily for documentation for users using your Terraform configuration. Terraform will prompt the description when asking to input value.

variable "bucket_name"{
    description = "A cool name for your bucket."
    type = "string"
}

Upvotes: 2

Related Questions