Mildwonkey/command tests (#24535)

* command: refactor testBackendState to write states.State

testBackendState was using the older terraform.State format, which is no
longer sufficient for most tests since the state upgrader does not
encode provider FQNs automatically. Users will run `terraform
0.13upgrade` to update their state to include provider FQNs in
resources, but tests need to use the modern state format instead of
relying on the automatic upgrade.

* plan tests passing
* graph tests passing
* json packages test update
* command test updates
* update show test fixtures
* state show tests passing
This commit is contained in:
Kristin Laemmert 2020-04-02 12:58:44 -04:00 committed by Martin Atkins
parent de6c9ccec1
commit 27a794062e
26 changed files with 104 additions and 107 deletions

View File

@ -701,7 +701,7 @@ func testInputMap(t *testing.T, answers map[string]string) func() {
// be returned about the backend configuration having changed and that // be returned about the backend configuration having changed and that
// "terraform init" must be run, since the test backend config cache created // "terraform init" must be run, since the test backend config cache created
// by this function contains the hash for an empty configuration. // by this function contains the hash for an empty configuration.
func testBackendState(t *testing.T, s *terraform.State, c int) (*terraform.State, *httptest.Server) { func testBackendState(t *testing.T, s *states.State, c int) (*terraform.State, *httptest.Server) {
t.Helper() t.Helper()
var b64md5 string var b64md5 string
@ -723,8 +723,8 @@ func testBackendState(t *testing.T, s *terraform.State, c int) (*terraform.State
// If a state was given, make sure we calculate the proper b64md5 // If a state was given, make sure we calculate the proper b64md5
if s != nil { if s != nil {
enc := json.NewEncoder(buf) err := statefile.Write(&statefile.File{State: s}, buf)
if err := enc.Encode(s); err != nil { if err != nil {
t.Fatalf("err: %v", err) t.Fatalf("err: %v", err)
} }
md5 := md5.Sum(buf.Bytes()) md5 := md5.Sum(buf.Bytes())

View File

@ -147,7 +147,7 @@ func formatStateModule(p blockBodyDiffPrinter, m *states.Module, schemas *terraf
// loaded all of the schemas and checked things prior to this // loaded all of the schemas and checked things prior to this
// point. We can't return errors here, but since this is UI code // point. We can't return errors here, but since this is UI code
// we will try to do _something_ reasonable. // we will try to do _something_ reasonable.
p.buf.WriteString(fmt.Sprintf("# missing schema for provider %q\n\n", provider.LegacyString())) p.buf.WriteString(fmt.Sprintf("# missing schema for provider %q\n\n", provider.String()))
continue continue
} }

View File

@ -33,7 +33,7 @@ func TestGraph(t *testing.T) {
} }
output := ui.OutputWriter.String() output := ui.OutputWriter.String()
if !strings.Contains(output, `provider["registry.terraform.io/-/test"]`) { if !strings.Contains(output, `provider["registry.terraform.io/hashicorp/test"]`) {
t.Fatalf("doesn't look like digraph: %s", output) t.Fatalf("doesn't look like digraph: %s", output)
} }
} }
@ -80,7 +80,7 @@ func TestGraph_noArgs(t *testing.T) {
} }
output := ui.OutputWriter.String() output := ui.OutputWriter.String()
if !strings.Contains(output, `provider["registry.terraform.io/-/test"]`) { if !strings.Contains(output, `provider["registry.terraform.io/hashicorp/test"]`) {
t.Fatalf("doesn't look like digraph: %s", output) t.Fatalf("doesn't look like digraph: %s", output)
} }
} }
@ -161,7 +161,7 @@ func TestGraph_plan(t *testing.T) {
} }
output := ui.OutputWriter.String() output := ui.OutputWriter.String()
if !strings.Contains(output, `provider["registry.terraform.io/-/test"]`) { if !strings.Contains(output, `provider["registry.terraform.io/hashicorp/test"]`) {
t.Fatalf("doesn't look like digraph: %s", output) t.Fatalf("doesn't look like digraph: %s", output)
} }
} }

View File

@ -252,7 +252,7 @@ func (p *plan) marshalResourceChanges(changes *plans.Changes, schemas *terraform
r.ModuleAddress = addr.Module.String() r.ModuleAddress = addr.Module.String()
r.Name = addr.Resource.Resource.Name r.Name = addr.Resource.Resource.Name
r.Type = addr.Resource.Resource.Type r.Type = addr.Resource.Resource.Type
r.ProviderName = rc.ProviderAddr.Provider.LegacyString() r.ProviderName = rc.ProviderAddr.Provider.String()
p.ResourceChanges = append(p.ResourceChanges, r) p.ResourceChanges = append(p.ResourceChanges, r)

View File

@ -164,7 +164,7 @@ func marshalPlanResources(changes *plans.Changes, ris []addrs.AbsResourceInstanc
Address: r.Addr.String(), Address: r.Addr.String(),
Type: r.Addr.Resource.Resource.Type, Type: r.Addr.Resource.Resource.Type,
Name: r.Addr.Resource.Resource.Name, Name: r.Addr.Resource.Resource.Name,
ProviderName: r.ProviderAddr.Provider.LegacyString(), ProviderName: r.ProviderAddr.Provider.String(),
Index: r.Addr.Resource.Key, Index: r.Addr.Resource.Key,
} }

View File

@ -198,7 +198,7 @@ func TestMarshalPlanResources(t *testing.T) {
Type: "test_thing", Type: "test_thing",
Name: "example", Name: "example",
Index: addrs.InstanceKey(nil), Index: addrs.InstanceKey(nil),
ProviderName: "test", ProviderName: "registry.terraform.io/hashicorp/test",
SchemaVersion: 1, SchemaVersion: 1,
AttributeValues: attributeValues{}, AttributeValues: attributeValues{},
}}, }},
@ -227,7 +227,7 @@ func TestMarshalPlanResources(t *testing.T) {
Type: "test_thing", Type: "test_thing",
Name: "example", Name: "example",
Index: addrs.InstanceKey(nil), Index: addrs.InstanceKey(nil),
ProviderName: "test", ProviderName: "registry.terraform.io/hashicorp/test",
SchemaVersion: 1, SchemaVersion: 1,
AttributeValues: attributeValues{ AttributeValues: attributeValues{
@ -259,7 +259,7 @@ func TestMarshalPlanResources(t *testing.T) {
Name: "example", Name: "example",
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance), }.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
ProviderAddr: addrs.AbsProviderConfig{ ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
ChangeSrc: plans.ChangeSrc{ ChangeSrc: plans.ChangeSrc{
@ -294,7 +294,7 @@ func TestMarshalPlanResources(t *testing.T) {
func testSchemas() *terraform.Schemas { func testSchemas() *terraform.Schemas {
return &terraform.Schemas{ return &terraform.Schemas{
Providers: map[addrs.Provider]*terraform.ProviderSchema{ Providers: map[addrs.Provider]*terraform.ProviderSchema{
addrs.NewLegacyProvider("test"): &terraform.ProviderSchema{ addrs.NewDefaultProvider("test"): &terraform.ProviderSchema{
ResourceTypes: map[string]*configschema.Block{ ResourceTypes: map[string]*configschema.Block{
"test_thing": { "test_thing": {
Attributes: map[string]*configschema.Attribute{ Attributes: map[string]*configschema.Attribute{

View File

@ -35,7 +35,7 @@ func Marshal(s *terraform.Schemas) ([]byte, error) {
providers := newProviders() providers := newProviders()
for k, v := range s.Providers { for k, v := range s.Providers {
providers.Schemas[k.LegacyString()] = marshalProvider(v) providers.Schemas[k.String()] = marshalProvider(v)
} }
ret, err := json.Marshal(providers) ret, err := json.Marshal(providers)

View File

@ -261,7 +261,7 @@ func marshalResources(resources map[string]*states.Resource, module addrs.Module
Address: r.Addr.Instance(k).String(), Address: r.Addr.Instance(k).String(),
Type: resAddr.Type, Type: resAddr.Type,
Name: resAddr.Name, Name: resAddr.Name,
ProviderName: r.ProviderConfig.Provider.LegacyString(), ProviderName: r.ProviderConfig.Provider.String(),
} }
switch resAddr.Mode { switch resAddr.Mode {

View File

@ -204,7 +204,7 @@ func TestMarshalResources(t *testing.T) {
}, },
}, },
ProviderConfig: addrs.AbsProviderConfig{ ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
}, },
@ -217,7 +217,7 @@ func TestMarshalResources(t *testing.T) {
Type: "test_thing", Type: "test_thing",
Name: "bar", Name: "bar",
Index: addrs.InstanceKey(nil), Index: addrs.InstanceKey(nil),
ProviderName: "test", ProviderName: "registry.terraform.io/hashicorp/test",
SchemaVersion: 1, SchemaVersion: 1,
AttributeValues: attributeValues{ AttributeValues: attributeValues{
"foozles": json.RawMessage(`null`), "foozles": json.RawMessage(`null`),
@ -248,7 +248,7 @@ func TestMarshalResources(t *testing.T) {
}, },
}, },
ProviderConfig: addrs.AbsProviderConfig{ ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
}, },
@ -261,7 +261,7 @@ func TestMarshalResources(t *testing.T) {
Type: "test_thing", Type: "test_thing",
Name: "bar", Name: "bar",
Index: addrs.IntKey(0), Index: addrs.IntKey(0),
ProviderName: "test", ProviderName: "registry.terraform.io/hashicorp/test",
SchemaVersion: 1, SchemaVersion: 1,
AttributeValues: attributeValues{ AttributeValues: attributeValues{
"foozles": json.RawMessage(`null`), "foozles": json.RawMessage(`null`),
@ -292,7 +292,7 @@ func TestMarshalResources(t *testing.T) {
}, },
}, },
ProviderConfig: addrs.AbsProviderConfig{ ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
}, },
@ -305,7 +305,7 @@ func TestMarshalResources(t *testing.T) {
Type: "test_thing", Type: "test_thing",
Name: "bar", Name: "bar",
Index: addrs.StringKey("rockhopper"), Index: addrs.StringKey("rockhopper"),
ProviderName: "test", ProviderName: "registry.terraform.io/hashicorp/test",
SchemaVersion: 1, SchemaVersion: 1,
AttributeValues: attributeValues{ AttributeValues: attributeValues{
"foozles": json.RawMessage(`null`), "foozles": json.RawMessage(`null`),
@ -338,7 +338,7 @@ func TestMarshalResources(t *testing.T) {
}, },
}, },
ProviderConfig: addrs.AbsProviderConfig{ ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
}, },
@ -351,7 +351,7 @@ func TestMarshalResources(t *testing.T) {
Type: "test_thing", Type: "test_thing",
Name: "bar", Name: "bar",
Index: addrs.InstanceKey(nil), Index: addrs.InstanceKey(nil),
ProviderName: "test", ProviderName: "registry.terraform.io/hashicorp/test",
DeposedKey: deposedKey.String(), DeposedKey: deposedKey.String(),
AttributeValues: attributeValues{ AttributeValues: attributeValues{
"foozles": json.RawMessage(`null`), "foozles": json.RawMessage(`null`),
@ -389,7 +389,7 @@ func TestMarshalResources(t *testing.T) {
}, },
}, },
ProviderConfig: addrs.AbsProviderConfig{ ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
}, },
@ -402,7 +402,7 @@ func TestMarshalResources(t *testing.T) {
Type: "test_thing", Type: "test_thing",
Name: "bar", Name: "bar",
Index: addrs.InstanceKey(nil), Index: addrs.InstanceKey(nil),
ProviderName: "test", ProviderName: "registry.terraform.io/hashicorp/test",
SchemaVersion: 1, SchemaVersion: 1,
AttributeValues: attributeValues{ AttributeValues: attributeValues{
"foozles": json.RawMessage(`null`), "foozles": json.RawMessage(`null`),
@ -415,7 +415,7 @@ func TestMarshalResources(t *testing.T) {
Type: "test_thing", Type: "test_thing",
Name: "bar", Name: "bar",
Index: addrs.InstanceKey(nil), Index: addrs.InstanceKey(nil),
ProviderName: "test", ProviderName: "registry.terraform.io/hashicorp/test",
DeposedKey: deposedKey.String(), DeposedKey: deposedKey.String(),
AttributeValues: attributeValues{ AttributeValues: attributeValues{
"foozles": json.RawMessage(`null`), "foozles": json.RawMessage(`null`),
@ -461,7 +461,7 @@ func TestMarshalModules_basic(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
) )
@ -476,7 +476,7 @@ func TestMarshalModules_basic(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: childModule.Module(), Module: childModule.Module(),
}, },
) )
@ -491,7 +491,7 @@ func TestMarshalModules_basic(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: subModule.Module(), Module: subModule.Module(),
}, },
) )
@ -530,7 +530,7 @@ func TestMarshalModules_nested(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
) )
@ -545,7 +545,7 @@ func TestMarshalModules_nested(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: childModule.Module(), Module: childModule.Module(),
}, },
) )
@ -560,7 +560,7 @@ func TestMarshalModules_nested(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: subModule.Module(), Module: subModule.Module(),
}, },
) )
@ -591,7 +591,7 @@ func TestMarshalModules_nested(t *testing.T) {
func testSchemas() *terraform.Schemas { func testSchemas() *terraform.Schemas {
return &terraform.Schemas{ return &terraform.Schemas{
Providers: map[addrs.Provider]*terraform.ProviderSchema{ Providers: map[addrs.Provider]*terraform.ProviderSchema{
addrs.NewLegacyProvider("test"): &terraform.ProviderSchema{ addrs.NewDefaultProvider("test"): &terraform.ProviderSchema{
ResourceTypes: map[string]*configschema.Block{ ResourceTypes: map[string]*configschema.Block{
"test_thing": { "test_thing": {
Attributes: map[string]*configschema.Attribute{ Attributes: map[string]*configschema.Attribute{

View File

@ -125,7 +125,7 @@ func TestPlan_destroy(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
) )
@ -244,7 +244,7 @@ func TestPlan_outPathNoChange(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
) )
@ -286,26 +286,23 @@ func TestPlan_outBackend(t *testing.T) {
defer os.RemoveAll(td) defer os.RemoveAll(td)
defer testChdir(t, td)() defer testChdir(t, td)()
// Our state originalState := states.BuildState(func(s *states.SyncState) {
originalState := &terraform.State{ s.SetResourceInstanceCurrent(
Modules: []*terraform.ModuleState{ addrs.Resource{
&terraform.ModuleState{ Mode: addrs.ManagedResourceMode,
Path: []string{"root"}, Type: "test_instance",
Resources: map[string]*terraform.ResourceState{ Name: "foo",
"test_instance.foo": &terraform.ResourceState{ }.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
Type: "test_instance", &states.ResourceInstanceObjectSrc{
Primary: &terraform.InstanceState{ AttrsJSON: []byte(`{"id":"bar","ami":"bar"}`),
ID: "bar", Status: states.ObjectReady,
Attributes: map[string]string{
"ami": "bar",
},
},
},
},
}, },
}, addrs.AbsProviderConfig{
} Provider: addrs.NewDefaultProvider("test"),
originalState.Init() Module: addrs.RootModule,
},
)
})
// Setup our backend state // Setup our backend state
dataState, srv := testBackendState(t, originalState, 200) dataState, srv := testBackendState(t, originalState, 200)

View File

@ -757,10 +757,10 @@ foo = "bar"
const testRefreshStr = ` const testRefreshStr = `
test_instance.foo: test_instance.foo:
ID = yes ID = yes
provider = provider["registry.terraform.io/-/test"] provider = provider["registry.terraform.io/hashicorp/test"]
` `
const testRefreshCwdStr = ` const testRefreshCwdStr = `
test_instance.foo: test_instance.foo:
ID = yes ID = yes
provider = provider["registry.terraform.io/-/test"] provider = provider["registry.terraform.io/hashicorp/test"]
` `

View File

@ -85,7 +85,7 @@ func TestShow_aliasedProvider(t *testing.T) {
Dependencies: []addrs.ConfigResource{}, Dependencies: []addrs.ConfigResource{},
DependsOn: []addrs.Referenceable{}, DependsOn: []addrs.Referenceable{},
}, },
addrs.RootModuleInstance.ProviderConfigAliased(addrs.NewLegacyProvider("test"), "alias"), addrs.RootModuleInstance.ProviderConfigAliased(addrs.NewDefaultProvider("test"), "alias"),
) )
}) })
@ -486,7 +486,7 @@ func showFixturePlanFile(t *testing.T, action plans.Action) string {
Name: "foo", Name: "foo",
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance), }.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
ProviderAddr: addrs.AbsProviderConfig{ ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
ChangeSrc: plans.ChangeSrc{ ChangeSrc: plans.ChangeSrc{

View File

@ -26,7 +26,7 @@ func TestStateShow(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
) )
@ -84,7 +84,7 @@ func TestStateShow_multi(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
) )
@ -99,7 +99,7 @@ func TestStateShow_multi(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"), Provider: addrs.NewDefaultProvider("test"),
Module: submod.Module(), Module: submod.Module(),
}, },
) )
@ -205,7 +205,7 @@ func TestStateShow_configured_provider(t *testing.T) {
Status: states.ObjectReady, Status: states.ObjectReady,
}, },
addrs.AbsProviderConfig{ addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test-beta"), Provider: addrs.NewDefaultProvider("test-beta"),
Module: addrs.RootModule, Module: addrs.RootModule,
}, },
) )
@ -230,7 +230,7 @@ func TestStateShow_configured_provider(t *testing.T) {
Meta: Meta{ Meta: Meta{
testingOverrides: &testingOverrides{ testingOverrides: &testingOverrides{
Providers: map[addrs.Provider]providers.Factory{ Providers: map[addrs.Provider]providers.Factory{
addrs.NewLegacyProvider("test-beta"): providers.FactoryFixed(p), addrs.NewDefaultProvider("test-beta"): providers.FactoryFixed(p),
}, },
}, },
Ui: ui, Ui: ui,

View File

@ -1,7 +1,7 @@
{ {
"format_version": "0.1", "format_version": "0.1",
"provider_schemas": { "provider_schemas": {
"test": { "registry.terraform.io/hashicorp/test": {
"resource_schemas": { "resource_schemas": {
"test_instance": { "test_instance": {
"version": 0, "version": 0,

View File

@ -10,7 +10,7 @@
"type": "test_instance", "type": "test_instance",
"name": "example", "name": "example",
"each": "list", "each": "list",
"provider": "provider.test", "provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
"instances": [ "instances": [
{ {
"index_key": 0, "index_key": 0,

View File

@ -17,7 +17,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "example", "name": "example",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar-var", "ami": "bar-var",
@ -35,7 +35,7 @@
"type": "test_instance", "type": "test_instance",
"name": "example", "name": "example",
"index": 0, "index": 0,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "foo-var", "ami": "foo-var",

View File

@ -16,7 +16,7 @@
"type": "test_instance", "type": "test_instance",
"name": "example", "name": "example",
"each": "list", "each": "list",
"provider": "provider.test", "provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
"instances": [ "instances": [
{ {
"index_key": 0, "index_key": 0,
@ -33,7 +33,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "example", "name": "example",
"provider": "provider.test", "provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
"instances": [ "instances": [
{ {
"schema_version": 0, "schema_version": 0,

View File

@ -20,7 +20,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar" "ami": "bar"
@ -32,7 +32,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar" "ami": "bar"
@ -44,7 +44,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar" "ami": "bar"
@ -71,7 +71,7 @@
"index": 0, "index": 0,
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"name": "test", "name": "test",
"change": { "change": {
"actions": [ "actions": [
@ -91,7 +91,7 @@
"index": 1, "index": 1,
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"name": "test", "name": "test",
"change": { "change": {
"actions": [ "actions": [
@ -111,7 +111,7 @@
"index": 2, "index": 2,
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"name": "test", "name": "test",
"change": { "change": {
"actions": [ "actions": [
@ -175,4 +175,4 @@
} }
} }
} }
} }

View File

@ -19,7 +19,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar", "ami": "bar",
@ -34,7 +34,7 @@
"address": "test_instance.test", "address": "test_instance.test",
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"name": "test", "name": "test",
"change": { "change": {
"actions": [ "actions": [
@ -55,7 +55,7 @@
"address": "test_instance.test-delete", "address": "test_instance.test-delete",
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"name": "test-delete", "name": "test-delete",
"change": { "change": {
"actions": [ "actions": [
@ -97,7 +97,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"values": { "values": {
"ami": "foo", "ami": "foo",
"id": "placeholder" "id": "placeholder"
@ -109,7 +109,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test-delete", "name": "test-delete",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"values": { "values": {
"ami": "foo", "ami": "foo",
"id": "placeholder" "id": "placeholder"
@ -154,4 +154,4 @@
} }
} }
} }
} }

View File

@ -9,7 +9,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider": "provider[\"registry.terraform.io/-/test\"]", "provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
"instances": [ "instances": [
{ {
"schema_version": 0, "schema_version": 0,
@ -24,7 +24,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test-delete", "name": "test-delete",
"provider": "provider[\"registry.terraform.io/-/test\"]", "provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
"instances": [ "instances": [
{ {
"schema_version": 0, "schema_version": 0,

View File

@ -19,7 +19,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar", "ami": "bar",
@ -34,7 +34,7 @@
"address": "test_instance.test", "address": "test_instance.test",
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"name": "test", "name": "test",
"change": { "change": {
"actions": [ "actions": [
@ -79,7 +79,7 @@
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"schema_version": 0, "schema_version": 0,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"values": { "values": {
"ami": "bar", "ami": "bar",
"id": "placeholder" "id": "placeholder"
@ -124,4 +124,4 @@
} }
} }
} }
} }

View File

@ -9,7 +9,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider": "provider[\"registry.terraform.io/-/test\"]", "provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
"instances": [ "instances": [
{ {
"schema_version": 0, "schema_version": 0,

View File

@ -16,7 +16,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar-var" "ami": "bar-var"
@ -33,7 +33,7 @@
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"index": 0, "index": 0,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "baz" "ami": "baz"
@ -45,7 +45,7 @@
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"index": 1, "index": 1,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "baz" "ami": "baz"
@ -57,7 +57,7 @@
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"index": 2, "index": 2,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "baz" "ami": "baz"
@ -88,7 +88,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"change": { "change": {
"actions": [ "actions": [
"create" "create"
@ -107,7 +107,7 @@
"module_address": "module.module_test_foo", "module_address": "module.module_test_foo",
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"name": "test", "name": "test",
"index": 0, "index": 0,
"change": { "change": {
@ -128,7 +128,7 @@
"module_address": "module.module_test_foo", "module_address": "module.module_test_foo",
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"name": "test", "name": "test",
"index": 1, "index": 1,
"change": { "change": {
@ -149,7 +149,7 @@
"module_address": "module.module_test_foo", "module_address": "module.module_test_foo",
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"name": "test", "name": "test",
"index": 2, "index": 2,
"change": { "change": {
@ -280,4 +280,4 @@
} }
} }
} }
} }

View File

@ -21,7 +21,7 @@
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"index": 0, "index": 0,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar", "ami": "bar",
@ -34,7 +34,7 @@
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"index": 1, "index": 1,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar" "ami": "bar"
@ -50,7 +50,7 @@
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"index": 0, "index": 0,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"change": { "change": {
"actions": [ "actions": [
"no-op" "no-op"
@ -72,7 +72,7 @@
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"index": 1, "index": 1,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"change": { "change": {
"actions": [ "actions": [
"create" "create"
@ -115,7 +115,7 @@
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"index": 0, "index": 0,
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar", "ami": "bar",

View File

@ -9,7 +9,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider": "provider[\"registry.terraform.io/-/test\"]", "provider": "provider[\"registry.terraform.io/hashicorp/test\"]",
"instances": [ "instances": [
{ {
"schema_version": 0, "schema_version": 0,

View File

@ -13,7 +13,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"schema_version": 0, "schema_version": 0,
"values": { "values": {
"ami": "bar-var" "ami": "bar-var"
@ -34,7 +34,7 @@
"mode": "managed", "mode": "managed",
"type": "test_instance", "type": "test_instance",
"name": "test", "name": "test",
"provider_name": "test", "provider_name": "registry.terraform.io/hashicorp/test",
"change": { "change": {
"actions": [ "actions": [
"create" "create"
@ -89,4 +89,4 @@
} }
} }
} }
} }