From e02e53ed4d59770640e6a3d74d9a61515824f34e Mon Sep 17 00:00:00 2001 From: Alisdair McDiarmid Date: Fri, 14 Aug 2020 15:40:48 -0400 Subject: [PATCH] states: Add roundtrip v3->v4 with builtin provider --- .../testdata/roundtrip/v3-builtin.in.tfstate | 39 +++++++++++++++++++ .../testdata/roundtrip/v3-builtin.out.tfstate | 31 +++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 states/statefile/testdata/roundtrip/v3-builtin.in.tfstate create mode 100644 states/statefile/testdata/roundtrip/v3-builtin.out.tfstate diff --git a/states/statefile/testdata/roundtrip/v3-builtin.in.tfstate b/states/statefile/testdata/roundtrip/v3-builtin.in.tfstate new file mode 100644 index 000000000..2e1ea0c66 --- /dev/null +++ b/states/statefile/testdata/roundtrip/v3-builtin.in.tfstate @@ -0,0 +1,39 @@ +{ + "version": 3, + "terraform_version": "0.11.14", + "serial": 1, + "lineage": "b707851e-4209-9792-e752-bc0dd6c81fcf", + "modules": [ + { + "path": [ + "root" + ], + "outputs": {}, + "resources": { + "data.terraform_remote_state.test": { + "type": "terraform_remote_state", + "depends_on": [], + "primary": { + "id": "2020-08-14 19:13:36.875081 +0000 UTC", + "attributes": { + "backend": "remote", + "config.#": "1", + "config.345861710.organization": "hashicorp", + "config.345861710.workspaces.#": "1", + "config.345861710.workspaces.0.%": "1", + "config.345861710.workspaces.0.name": "test", + "environment": "default", + "id": "2020-08-14 19:13:36.875081 +0000 UTC", + "workspace": "default" + }, + "meta": {}, + "tainted": false + }, + "deposed": [], + "provider": "provider.terraform" + } + }, + "depends_on": [] + } + ] +} diff --git a/states/statefile/testdata/roundtrip/v3-builtin.out.tfstate b/states/statefile/testdata/roundtrip/v3-builtin.out.tfstate new file mode 100644 index 000000000..baef96941 --- /dev/null +++ b/states/statefile/testdata/roundtrip/v3-builtin.out.tfstate @@ -0,0 +1,31 @@ +{ + "version": 4, + "terraform_version": "0.12.28", + "serial": 1, + "lineage": "b707851e-4209-9792-e752-bc0dd6c81fcf", + "outputs": {}, + "resources": [ + { + "mode": "data", + "type": "terraform_remote_state", + "name": "test", + "provider": "provider.terraform", + "instances": [ + { + "schema_version": 0, + "attributes_flat": { + "backend": "remote", + "config.#": "1", + "config.345861710.organization": "hashicorp", + "config.345861710.workspaces.#": "1", + "config.345861710.workspaces.0.%": "1", + "config.345861710.workspaces.0.name": "test", + "environment": "default", + "id": "2020-08-14 19:13:36.875081 +0000 UTC", + "workspace": "default" + } + } + ] + } + ] +}