2

I want to create a variable that has a single value, a list of elements. So I did:

variable "cipher_suites" = {
     type    = list(string)
     default =  [
      "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
      "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
     ]
}

and this

   variable "cipher_suites" {
         type    = "list"
         default =  [
          "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
          "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
         ]
    }

but then I get a lot of errors like this regarding my declaration and initialization:

This character is not used
2019-10-09T06:41:12.2239556Z within the language.

What am I doing wrong here?

Yoda
  • 17,363
  • 67
  • 204
  • 344

1 Answers1

4

This is the rigth way, and it works for me.

 variable "cipher_suites" {
         type    = list(string)
         default =  [
          "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
          "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
         ]
    }

Hope it help, if this don't work for you, probably is another error, maybe some imports or something like that.

P4uB0rd4
  • 175
  • 5
  • Thank you very much! I don't understand, after I tried your syntax(it works) and then modifying to the 2nd form presented by me in the question it works too. Does HCL blacklists some whitespace characters? – Yoda Oct 09 '19 at 08:40
  • I think so, but the problem with the 1st was the equal assigment. – P4uB0rd4 Oct 09 '19 at 08:53