0

I am using Terraform 0.8.8 and it keeps asking me to interactively input certain variables (the first being var.allowed_ips_app_elb_https_env_specific).

I have a variables.tf file which contains all of the variables I want to input, yet it keeps asking me to input them when I run a terraform plan.

All of our code has been committed to our internal Gitlab and my colleague can run the same code without it asking him to interactively inputting the variables.

The following is part of the variables.tf file that asking me to input the variables when I run the plan command.

# Allowed IPs to both dev/prod environments.
variable "allowed_ips_app_elb_https" {
  default =
  [ "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
    "*.*.*.*/*",      # *
  ]
}

^ I have removed the IPs and comments and change them to *.

Thanks,

O.R

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
O.R
  • 1
  • 1
  • 1

1 Answers1

0

Terraform 0.8.8 is almost a year old - it's possible that changes have been made since then regarding automatic parsing of .tf / variable files. Have you verified which version your colleague is running? Even if you can't upgrade to the latest, it would be a good idea to use a consistent version across teams.

In the meantime you can try explicitly loading a Terraform variable file using the var-file argument:

terraform plan -var-file=variables.tf

You should also double check that the contents of your variable file is correct - you are creating a variable called allowed_ips_app_elb_https, but somewhere in your Terraform files you are requesting a different variable called allowed_ips_app_elb_https_env_specific.

duncanhall
  • 11,035
  • 5
  • 54
  • 86