terraform/config/test-fixtures
James Nugent cb6cb8b96a core: Support explicit variable type declaration
This commit adds support for declaring variable types in Terraform
configuration. Historically, the type has been inferred from the default
value, defaulting to string if no default was supplied. This has caused
users to devise workarounds if they wanted to declare a map but provide
values from a .tfvars file (for example).

The new syntax adds the "type" key to variable blocks:

```
variable "i_am_a_string" {
    type = "string"
}

variable "i_am_a_map" {
    type = "map"
}
```

This commit does _not_ extend the type system to include bools, integers
or floats - the only two types available are maps and strings.

Validation is performed if a default value is provided in order to
ensure that the default value type matches the declared type.

In the case that a type is not declared, the old logic is used for
determining the type. This allows backwards compatiblity with previous
Terraform configuration.
2016-01-24 11:40:02 -06:00
..
count-int config: add Config method 2014-10-02 11:34:08 -07:00
count-string config: add Config method 2014-10-02 11:34:08 -07:00
count-var config: add Config method 2014-10-02 11:34:08 -07:00
dir-basic config: HCL loader 2014-08-11 09:58:53 -07:00
dir-empty config: LoadDir with no matching files errors 2014-07-11 21:04:59 -07:00
dir-merge config: HCL loader 2014-08-11 09:58:53 -07:00
dir-override config: HCL loader 2014-08-11 09:58:53 -07:00
dir-temporary-files Ignore hidden files per Unix conventions 2015-03-18 07:50:33 +00:00
import dos2unix 2014-07-28 10:43:00 -07:00
interpolations config: unit tests for lexer 2014-09-09 14:34:03 -07:00
validate-bad-depends-on dos2unix 2014-07-28 10:43:00 -07:00
validate-bad-multi-resource dos2unix 2014-07-28 10:43:00 -07:00
validate-count-bad-context core: protect against count.index in modules 2015-04-15 10:41:56 -05:00
validate-count-below-zero dos2unix 2014-07-28 10:43:00 -07:00
validate-count-count-var config: count can't interpolate count variables 2014-10-02 18:22:32 -07:00
validate-count-int config: validate that count is an int 2014-10-02 16:51:20 -07:00
validate-count-module-var config: validate that only proper variables can be in the count 2014-10-02 16:30:46 -07:00
validate-count-not-int config: validate that count is an int 2014-10-02 16:51:20 -07:00
validate-count-resource-var config: validate that only proper variables can be in the count 2014-10-02 16:30:46 -07:00
validate-count-user-var config: validate that only proper variables can be in the count 2014-10-02 16:30:46 -07:00
validate-count-var config: validate good count variables 2014-10-02 18:25:18 -07:00
validate-count-var-invalid config: validate that count vars are valid types 2014-10-02 18:24:37 -07:00
validate-count-zero dos2unix 2014-07-28 10:43:00 -07:00
validate-depends-on-var config: depends on cannot contain interpolations [GH-985] 2015-02-20 09:07:41 -08:00
validate-dup-module config: validate no duplicate modules 2014-09-11 16:02:36 -07:00
validate-dup-resource dos2unix 2014-07-28 10:43:00 -07:00
validate-good config: HCL loader 2014-08-11 09:58:53 -07:00
validate-module-name-bad config: validate module names are valid 2014-10-08 16:03:22 -07:00
validate-module-source-var config: validate that module source can't contain interpolations 2014-10-07 20:19:32 -07:00
validate-module-var-int config: validate that module variables can go to ints, convert [GH-624] 2014-12-15 22:10:16 -08:00
validate-module-var-map config: validate that module variables can go to ints, convert [GH-624] 2014-12-15 22:10:16 -08:00
validate-module-var-self config: error in validation if module has self variable 2015-04-22 10:39:07 +02:00
validate-output-bad-field dos2unix 2014-07-28 10:43:00 -07:00
validate-output-missing-equals config: validation error when output is missing value field 2016-01-20 14:00:36 -06:00
validate-path-var config: parse ${path.module} 2014-10-07 18:03:11 -07:00
validate-path-var-invalid config: parse ${path.module} 2014-10-07 18:03:11 -07:00
validate-prov-conn-splat-other config: test we can ref splat of other resources 2015-02-20 09:19:13 -08:00
validate-prov-conn-splat-self config: validate configuration doens't contain splats to ourselves 2015-02-20 09:18:08 -08:00
validate-prov-splat-other config: validate provisioner splats can only reference others 2015-02-20 09:21:29 -08:00
validate-prov-splat-self config: validate provisioner splats can only reference others 2015-02-20 09:21:29 -08:00
validate-provider-multi config: validate that a multi provider is only configured once each 2015-04-20 14:25:33 -07:00
validate-provider-multi-good config: happy case test for multiple providers 2015-04-20 14:27:44 -07:00
validate-provider-multi-ref-bad config: test that resources reference good providers 2015-04-20 14:47:31 -07:00
validate-provider-multi-ref-good config: test that resources reference good providers 2015-04-20 14:47:31 -07:00
validate-resource-prov-self config: self var validation 2015-02-23 14:43:14 -08:00
validate-resource-self config: self var validation 2015-02-23 14:43:14 -08:00
validate-unknown-resource-var dos2unix 2014-07-28 10:43:00 -07:00
validate-unknown-resource-var-output dos2unix 2014-07-28 10:43:00 -07:00
validate-unknownthing config: HCL loader 2014-08-11 09:58:53 -07:00
validate-unknownvar config: HCL loader 2014-08-11 09:58:53 -07:00
validate-unknownvar-count config: validate unknown var in count 2014-10-02 11:18:57 -07:00
validate-var-default config: HCL loader 2014-08-11 09:58:53 -07:00
validate-var-default-bad-type dos2unix 2014-07-28 10:43:00 -07:00
validate-var-default-interpolate config: validate no interp in var [GH-180] 2014-08-11 09:46:56 -07:00
validate-var-module config: validate that variables reference valid modules 2014-09-15 11:45:41 -07:00
validate-var-module-invalid config: validate that variables reference valid modules 2014-09-15 11:45:41 -07:00
validate-var-multi-exact-non-slice config: allow exact multi-resource references outside slices 2014-10-11 17:20:39 -07:00
validate-var-multi-func config: multi-variable access in slice validation fixed [GH-798] 2015-01-15 09:40:13 -08:00
validate-var-multi-non-slice config: validate that multi-variables are only used in slices 2014-10-09 21:15:08 -07:00
validate-var-multi-non-slice-provisioner config: bare splat variables should not be allowed in provisioners 2015-02-17 13:32:45 -08:00
.gitattributes Add regression test for #4069 2015-12-01 13:37:18 -05:00
attributes.tf Add failing tests for JSON configuration parsing 2015-11-19 16:06:30 +02:00
attributes.tf.json Add failing tests for JSON configuration parsing 2015-11-19 16:06:30 +02:00
bad-variable-type.tf core: Support explicit variable type declaration 2016-01-24 11:40:02 -06:00
bad_type.tf.nope dos2unix 2014-07-28 10:43:00 -07:00
basic.tf core: Support explicit variable type declaration 2016-01-24 11:40:02 -06:00
basic.tf.json core: Support explicit variable type declaration 2016-01-24 11:40:02 -06:00
connection.tf dos2unix 2014-07-28 10:43:00 -07:00
create-before-destroy.tf terraform: Adding lifecycle config block 2014-09-29 15:20:02 -07:00
empty.tf config: add test for empty file 2014-09-15 09:41:00 -07:00
escapedquotes.tf config: test covering escaped quotes syntax error 2015-11-19 12:11:42 -06:00
heredoc.tf config: test replicating #4079 2015-12-01 10:31:05 -06:00
ignore-changes.tf Adding ignore_changes lifecycle meta property 2015-10-14 16:34:27 -05:00
import.tf config: HCL loader 2014-08-11 09:58:53 -07:00
lifecycle_cbd_typo.tf config: validate lifecycle keys [GH-4413] 2016-01-19 11:28:45 -08:00
modules.tf config: change module syntax 2014-09-14 14:43:54 -07:00
prevent-destroy-string.tf config: parse lifecycle block with mapstructure for weak decode 2015-06-07 22:04:23 -07:00
provisioners.tf dos2unix 2014-07-28 10:43:00 -07:00
resource-arity-mistake.tf config: friendlier error message on resource arity mismatch 2015-12-09 18:05:49 -06:00
variable-mismatched-type.tf core: Support explicit variable type declaration 2016-01-24 11:40:02 -06:00
variables.tf dos2unix 2014-07-28 10:43:00 -07:00
windows-line-endings.tf Add regression test for #4069 2015-12-01 13:37:18 -05:00