Quantcast
Channel: Terraform - HashiCorp Discuss
Viewing all articles
Browse latest Browse all 11446

Inconsistent syntaxing?

$
0
0

@davidcsi wrote:

Hello,

I’m working with

# terraform -v                                                                                                                                                                        
Terraform v0.12.24
+ provider.aws v2.56.0
+ provider.random v2.2.1

if i go into the console and do:

> { "a"= "b", "c"= "d"}
{
  "a" = "b"
  "c" = "d"
}

seems to work, but if i do on a tf file:

variable "servers" {
    "ip_address" = "1.2.3.4"
    "hc_port" = "80"
}

I get:
Error: Invalid argument name

  on test.tf line 13, in variable "servers":
  13:     "ip_address" = "1.2.3.4"

Argument names must not be quoted.

And if i unquote them:

Error: Unsupported argument

  on test.tf line 13, in variable "servers":
  13:     ip_address = "1.2.3.4"

An argument named "ip_address" is not expected here.

What is the expected way of creating maps, since “map” is going to be deprecated as per https://www.terraform.io/docs/configuration/functions/map.html ?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 11446

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>