Commit Graph

13 Commits

Author SHA1 Message Date
James Nugent
681d94ae20 core: Allow lists and maps as variable overrides
Terraform 0.7 introduces lists and maps as first-class values for
variables, in addition to string values which were previously available.
However, there was previously no way to override the default value of a
list or map, and the functionality for overriding specific map keys was
broken.

Using the environment variable method for setting variable values, there
was previously no way to give a variable a value of a list or map. These
now support HCL for individual values - specifying:

    TF_VAR_test='["Hello", "World"]'

will set the variable `test` to a two-element list containing "Hello"
and "World". Specifying

    TF_VAR_test_map='{"Hello = "World", "Foo" = "bar"}'

will set the variable `test_map` to a two-element map with keys "Hello"
and "Foo", and values "World" and "bar" respectively.

The same logic is applied to `-var` flags, and the file parsed by
`-var-files` ("autoVariables").

Note that care must be taken to not run into shell expansion for `-var-`
flags and environment variables.

We also merge map keys where appropriate. The override syntax has
changed (to be noted in CHANGELOG as a breaking change), so several
tests needed their syntax updating from the old `amis.us-east-1 =
"newValue"` style to `amis = "{ "us-east-1" = "newValue"}"` style as
defined in TF-002.

In order to continue supporting the `-var "foo=bar"` type of variable
flag (which is not valid HCL), a special case error is checked after HCL
parsing fails, and the old code path runs instead.
2016-07-26 15:27:29 -05:00
Maxime Bury
c98f391bee Add basic implementation for remote state on azure (#7064)
* Add basic implementation for remote state on azure

* Don't auto-provision the container

* Fix compilation errors

* Add factory to the remote map

* Add documentation

* Add acceptance tests
2016-06-10 19:27:57 +02:00
Matt Morrison
cbfb4d8b86 remote state: Add GCS provider for remote state 2016-05-31 13:42:57 -05:00
John Gosset
61e890ecc9 Update list of backends in RemoteConfigCommand's Help() method 2015-10-25 16:46:02 -04:00
Anthony Scalisi
198e1a5186 remove various typos 2015-09-11 11:56:20 -07:00
Radek Simko
b7d41d2eed Add -no-color to help text 2015-06-22 13:14:01 +01:00
Mitchell Hashimoto
4a7b554cf7 command/remote-config: do a pull with terraform remote config 2015-03-26 17:57:45 -07:00
Mitchell Hashimoto
38b1a727bf command/remote-config: lowercase the type so that Atlas works, for
example
2015-03-26 17:37:05 -07:00
Mitchell Hashimoto
7bfa5afd00 command/remote-config: show flag parse errors
/cc @sethvargo
2015-03-26 17:33:58 -07:00
Mitchell Hashimoto
35da19cc1f command/remote-config: remove weird error case that shows no error
message

/cc @sethvargo
2015-03-26 17:31:50 -07:00
Mitchell Hashimoto
431f5e6706 command/remote-config: syntax 2015-03-25 15:26:38 -07:00
Mitchell Hashimoto
2796f83950 command/remote-config: make the error message nicer for remote init
/cc @sethvargo - based on UX issues you ran into yesterday
2015-03-25 15:23:04 -07:00
Mitchell Hashimoto
01cd761023 command: move remote configuration stuff 2015-03-04 16:17:30 -08:00