diff --git a/configs/configupgrade/test-fixtures/valid/map-attr-as-block/input/map-attr-as-block.tf b/configs/configupgrade/test-fixtures/valid/map-attr-as-block/input/map-attr-as-block.tf new file mode 100644 index 0000000000..e0025e8ed7 --- /dev/null +++ b/configs/configupgrade/test-fixtures/valid/map-attr-as-block/input/map-attr-as-block.tf @@ -0,0 +1,7 @@ +resource "test_instance" "foo" { + type = "z1.weedy" + image = "image-abcd" + tags { + name = "boop" + } +} diff --git a/configs/configupgrade/test-fixtures/valid/map-attr-as-block/want/map-attr-as-block.tf b/configs/configupgrade/test-fixtures/valid/map-attr-as-block/want/map-attr-as-block.tf new file mode 100644 index 0000000000..abdb2da0b3 --- /dev/null +++ b/configs/configupgrade/test-fixtures/valid/map-attr-as-block/want/map-attr-as-block.tf @@ -0,0 +1,7 @@ +resource "test_instance" "foo" { + type = "z1.weedy" + image = "image-abcd" + tags = { + name = "boop" + } +} diff --git a/configs/configupgrade/test-fixtures/valid/map-attr-as-block/want/versions.tf b/configs/configupgrade/test-fixtures/valid/map-attr-as-block/want/versions.tf new file mode 100644 index 0000000000..d9b6f790b9 --- /dev/null +++ b/configs/configupgrade/test-fixtures/valid/map-attr-as-block/want/versions.tf @@ -0,0 +1,3 @@ +terraform { + required_version = ">= 0.12" +} diff --git a/configs/configupgrade/test-fixtures/valid/noop/input/resources.tf b/configs/configupgrade/test-fixtures/valid/noop/input/resources.tf index 9e2c246660..e8210aa232 100644 --- a/configs/configupgrade/test-fixtures/valid/noop/input/resources.tf +++ b/configs/configupgrade/test-fixtures/valid/noop/input/resources.tf @@ -1,3 +1,3 @@ -resource "test_resource" "example" { +resource "test_instance" "example" { } diff --git a/configs/configupgrade/test-fixtures/valid/noop/want/resources.tf b/configs/configupgrade/test-fixtures/valid/noop/want/resources.tf index 9e2c246660..e8210aa232 100644 --- a/configs/configupgrade/test-fixtures/valid/noop/want/resources.tf +++ b/configs/configupgrade/test-fixtures/valid/noop/want/resources.tf @@ -1,3 +1,3 @@ -resource "test_resource" "example" { +resource "test_instance" "example" { } diff --git a/configs/configupgrade/upgrade_test.go b/configs/configupgrade/upgrade_test.go index 57f9b1b4fb..7dab47e6a1 100644 --- a/configs/configupgrade/upgrade_test.go +++ b/configs/configupgrade/upgrade_test.go @@ -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},