configs/configupgrade: Test that map attrs as blocks are fixed
The old parser was forgiving in allowing the use of block syntax where a map attribute was expected, but the new parser is not (in order to allow for dynamic map keys, for expressions, etc) and so the upgrade tool must fix these to use attribute syntax.
This commit is contained in:
parent
1aa368d0d8
commit
bdb724562c
|
@ -0,0 +1,7 @@
|
|||
resource "test_instance" "foo" {
|
||||
type = "z1.weedy"
|
||||
image = "image-abcd"
|
||||
tags {
|
||||
name = "boop"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
resource "test_instance" "foo" {
|
||||
type = "z1.weedy"
|
||||
image = "image-abcd"
|
||||
tags = {
|
||||
name = "boop"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
terraform {
|
||||
required_version = ">= 0.12"
|
||||
}
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
resource "test_resource" "example" {
|
||||
resource "test_instance" "example" {
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
resource "test_resource" "example" {
|
||||
resource "test_instance" "example" {
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ var testProviders = map[string]providers.Factory{
|
|||
p := &terraform.MockProvider{}
|
||||
p.GetSchemaReturn = &terraform.ProviderSchema{
|
||||
ResourceTypes: map[string]*configschema.Block{
|
||||
"test_resource": {
|
||||
"test_instance": {
|
||||
Attributes: map[string]*configschema.Attribute{
|
||||
"id": {Type: cty.String, Computed: true},
|
||||
"type": {Type: cty.String, Optional: true},
|
||||
|
|
Loading…
Reference in New Issue