finish provider ModuleInstance replacement
This commit is contained in:
parent
98cfb51f27
commit
e13eecbc5b
|
@ -217,7 +217,7 @@ func TestLocal_planDeposedOnly(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}))
|
}))
|
||||||
|
@ -661,7 +661,7 @@ func testPlanState() *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return state
|
return state
|
||||||
|
@ -688,7 +688,7 @@ func testPlanState_withDataSource() *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
rootModule.SetResourceInstanceCurrent(
|
rootModule.SetResourceInstanceCurrent(
|
||||||
|
@ -705,7 +705,7 @@ func testPlanState_withDataSource() *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return state
|
return state
|
||||||
|
@ -732,7 +732,7 @@ func testPlanState_tainted() *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return state
|
return state
|
||||||
|
|
|
@ -152,7 +152,7 @@ func TestBackendStates(t *testing.T, b Backend) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ func TestApply_destroy(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -127,7 +127,7 @@ func TestApply_destroyLockedState(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -202,7 +202,7 @@ func TestApply_destroyTargeted(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -218,7 +218,7 @@ func TestApply_destroyTargeted(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -835,7 +835,7 @@ func TestApply_refresh(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -992,7 +992,7 @@ func TestApply_state(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -1359,7 +1359,7 @@ func TestApply_backup(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -1663,7 +1663,7 @@ func applyFixturePlanFile(t *testing.T) string {
|
||||||
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
|
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
ChangeSrc: plans.ChangeSrc{
|
ChangeSrc: plans.ChangeSrc{
|
||||||
Action: plans.Create,
|
Action: plans.Create,
|
||||||
|
|
|
@ -273,7 +273,7 @@ func testState() *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
// DeepCopy is used here to ensure our synthetic state matches exactly
|
// DeepCopy is used here to ensure our synthetic state matches exactly
|
||||||
|
|
|
@ -3159,7 +3159,7 @@ func runTestCases(t *testing.T, testCases map[string]testCase) {
|
||||||
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
|
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
ChangeSrc: plans.ChangeSrc{
|
ChangeSrc: plans.ChangeSrc{
|
||||||
Action: tc.Action,
|
Action: tc.Action,
|
||||||
|
|
|
@ -245,7 +245,7 @@ func basicState(t *testing.T) *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
rootModule.SetResourceInstanceCurrent(
|
rootModule.SetResourceInstanceCurrent(
|
||||||
|
@ -261,7 +261,7 @@ func basicState(t *testing.T) *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return state
|
return state
|
||||||
|
@ -297,7 +297,7 @@ func stateWithMoreOutputs(t *testing.T) *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return state
|
return state
|
||||||
|
@ -324,7 +324,7 @@ func nestedState(t *testing.T) *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return state
|
return state
|
||||||
|
@ -347,7 +347,7 @@ func deposedState(t *testing.T) *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return state
|
return state
|
||||||
|
@ -376,7 +376,7 @@ func onlyDeposedState(t *testing.T) *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
rootModule.SetResourceInstanceDeposed(
|
rootModule.SetResourceInstanceDeposed(
|
||||||
|
@ -393,7 +393,7 @@ func onlyDeposedState(t *testing.T) *states.State {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return state
|
return state
|
||||||
|
|
|
@ -127,7 +127,7 @@ func TestGraph_plan(t *testing.T) {
|
||||||
},
|
},
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
emptyConfig, err := plans.NewDynamicValue(cty.EmptyObjectVal, cty.EmptyObject)
|
emptyConfig, err := plans.NewDynamicValue(cty.EmptyObjectVal, cty.EmptyObject)
|
||||||
|
|
|
@ -260,7 +260,7 @@ func TestMarshalPlanResources(t *testing.T) {
|
||||||
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
|
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
ChangeSrc: plans.ChangeSrc{
|
ChangeSrc: plans.ChangeSrc{
|
||||||
Action: test.Action,
|
Action: test.Action,
|
||||||
|
|
|
@ -203,7 +203,7 @@ func TestMarshalResources(t *testing.T) {
|
||||||
},
|
},
|
||||||
ProviderConfig: addrs.AbsProviderConfig{
|
ProviderConfig: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -245,7 +245,7 @@ func TestMarshalResources(t *testing.T) {
|
||||||
},
|
},
|
||||||
ProviderConfig: addrs.AbsProviderConfig{
|
ProviderConfig: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -287,7 +287,7 @@ func TestMarshalResources(t *testing.T) {
|
||||||
},
|
},
|
||||||
ProviderConfig: addrs.AbsProviderConfig{
|
ProviderConfig: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -331,7 +331,7 @@ func TestMarshalResources(t *testing.T) {
|
||||||
},
|
},
|
||||||
ProviderConfig: addrs.AbsProviderConfig{
|
ProviderConfig: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -380,7 +380,7 @@ func TestMarshalResources(t *testing.T) {
|
||||||
},
|
},
|
||||||
ProviderConfig: addrs.AbsProviderConfig{
|
ProviderConfig: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -452,7 +452,7 @@ func TestMarshalModules_basic(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -467,7 +467,7 @@ func TestMarshalModules_basic(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: childModule,
|
Module: childModule.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -482,7 +482,7 @@ func TestMarshalModules_basic(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: subModule,
|
Module: subModule.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -521,7 +521,7 @@ func TestMarshalModules_nested(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -536,7 +536,7 @@ func TestMarshalModules_nested(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: childModule,
|
Module: childModule.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -551,7 +551,7 @@ func TestMarshalModules_nested(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: subModule,
|
Module: subModule.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -126,7 +126,7 @@ func TestPlan_destroy(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -245,7 +245,7 @@ func TestPlan_outPathNoChange(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -487,7 +487,7 @@ func showFixturePlanFile(t *testing.T, action plans.Action) string {
|
||||||
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
|
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
ChangeSrc: plans.ChangeSrc{
|
ChangeSrc: plans.ChangeSrc{
|
||||||
Action: action,
|
Action: action,
|
||||||
|
|
|
@ -29,7 +29,7 @@ func TestStateMv(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -45,7 +45,7 @@ func TestStateMv(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -160,7 +160,7 @@ func TestStateMv_resourceToInstance(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -176,7 +176,7 @@ func TestStateMv_resourceToInstance(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceMeta(
|
s.SetResourceMeta(
|
||||||
|
@ -188,7 +188,7 @@ func TestStateMv_resourceToInstance(t *testing.T) {
|
||||||
states.EachList,
|
states.EachList,
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -250,7 +250,7 @@ func TestStateMv_instanceToResource(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -265,7 +265,7 @@ func TestStateMv_instanceToResource(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -338,7 +338,7 @@ func TestStateMv_instanceToNewResource(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -409,7 +409,7 @@ func TestStateMv_differentResourceTypes(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -462,7 +462,7 @@ func TestStateMv_explicitWithBackend(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -477,7 +477,7 @@ func TestStateMv_explicitWithBackend(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -537,7 +537,7 @@ func TestStateMv_backupExplicit(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -553,7 +553,7 @@ func TestStateMv_backupExplicit(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -602,7 +602,7 @@ func TestStateMv_stateOutNew(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -656,7 +656,7 @@ func TestStateMv_stateOutExisting(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -675,7 +675,7 @@ func TestStateMv_stateOutExisting(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -755,7 +755,7 @@ func TestStateMv_stateOutNew_count(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -770,7 +770,7 @@ func TestStateMv_stateOutNew_count(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -785,7 +785,7 @@ func TestStateMv_stateOutNew_count(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -843,7 +843,7 @@ func TestStateMv_stateOutNew_largeCount(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -859,7 +859,7 @@ func TestStateMv_stateOutNew_largeCount(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -913,7 +913,7 @@ func TestStateMv_stateOutNew_nestedModule(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -928,7 +928,7 @@ func TestStateMv_stateOutNew_nestedModule(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -983,7 +983,7 @@ func TestStateMv_toNewModule(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -1056,7 +1056,7 @@ func TestStateMv_withinBackend(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -1072,7 +1072,7 @@ func TestStateMv_withinBackend(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -27,7 +27,7 @@ func TestStateRm(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -42,7 +42,7 @@ func TestStateRm(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -92,7 +92,7 @@ func TestStateRmNotChildModule(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
// This second instance has the same local address as the first but
|
// This second instance has the same local address as the first but
|
||||||
|
@ -110,7 +110,7 @@ func TestStateRmNotChildModule(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -181,7 +181,7 @@ func TestStateRmNoArgs(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -196,7 +196,7 @@ func TestStateRmNoArgs(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -240,7 +240,7 @@ func TestStateRmNonExist(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -255,7 +255,7 @@ func TestStateRmNonExist(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -300,7 +300,7 @@ func TestStateRm_backupExplicit(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -315,7 +315,7 @@ func TestStateRm_backupExplicit(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -416,7 +416,7 @@ func TestStateRm_backendState(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -431,7 +431,7 @@ func TestStateRm_backendState(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -120,7 +120,7 @@ func (c *StateShowCommand) Run(args []string) int {
|
||||||
absPc := addrs.AbsProviderConfig{
|
absPc := addrs.AbsProviderConfig{
|
||||||
Provider: rs.ProviderConfig.Provider,
|
Provider: rs.ProviderConfig.Provider,
|
||||||
Alias: rs.ProviderConfig.Alias,
|
Alias: rs.ProviderConfig.Alias,
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
}
|
}
|
||||||
singleInstance := states.NewState()
|
singleInstance := states.NewState()
|
||||||
singleInstance.EnsureModule(addr.Module).SetResourceInstanceCurrent(
|
singleInstance.EnsureModule(addr.Module).SetResourceInstanceCurrent(
|
||||||
|
|
|
@ -27,7 +27,7 @@ func TestStateShow(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -85,7 +85,7 @@ func TestStateShow_multi(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -100,7 +100,7 @@ func TestStateShow_multi(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: submod,
|
Module: submod.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -206,7 +206,7 @@ func TestStateShow_configured_provider(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test-beta"),
|
Provider: addrs.NewLegacyProvider("test-beta"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -26,7 +26,7 @@ func TestTaint(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -64,7 +64,7 @@ func TestTaint_lockedState(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -253,7 +253,7 @@ func TestTaint_missing(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -289,7 +289,7 @@ func TestTaint_missingAllow(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -368,7 +368,7 @@ func TestTaint_module(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -383,7 +383,7 @@ func TestTaint_module(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -25,7 +25,7 @@ func TestUntaint(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -68,7 +68,7 @@ func TestUntaint_lockedState(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -279,7 +279,7 @@ func TestUntaint_missing(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -315,7 +315,7 @@ func TestUntaint_missingAllow(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -403,7 +403,7 @@ func TestUntaint_module(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -418,7 +418,7 @@ func TestUntaint_module(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -243,7 +243,7 @@ func TestWorkspace_createWithState(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -43,7 +43,7 @@ func TestStateShim(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
rootModule.SetResourceInstanceCurrent(
|
rootModule.SetResourceInstanceCurrent(
|
||||||
|
@ -59,7 +59,7 @@ func TestStateShim(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ func TestStateShim(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: childInstance,
|
Module: childInstance.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
childModule.SetResourceInstanceCurrent(
|
childModule.SetResourceInstanceCurrent(
|
||||||
|
@ -102,7 +102,7 @@ func TestStateShim(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: childInstance,
|
Module: childInstance.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ func TestStateShim(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: childInstance,
|
Module: childInstance.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ func TestStateShim(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: childInstance,
|
Module: childInstance.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
childModule.SetResourceInstanceCurrent(
|
childModule.SetResourceInstanceCurrent(
|
||||||
|
@ -161,7 +161,7 @@ func TestStateShim(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: childInstance,
|
Module: childInstance.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ func TestStateShim(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: childInstance,
|
Module: childInstance.Module(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -729,7 +729,7 @@ func testIDOnlyRefresh(c TestCase, opts terraform.ContextOpts, step TestStep, r
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewDefaultProvider("placeholder"),
|
Provider: addrs.NewDefaultProvider("placeholder"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ func TestProviderAddrs(t *testing.T) {
|
||||||
Name: "woot",
|
Name: "woot",
|
||||||
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -33,7 +33,7 @@ func TestProviderAddrs(t *testing.T) {
|
||||||
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
||||||
DeposedKey: "foodface",
|
DeposedKey: "foodface",
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -44,7 +44,7 @@ func TestProviderAddrs(t *testing.T) {
|
||||||
Name: "what",
|
Name: "what",
|
||||||
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance.Child("foo", addrs.NoKey),
|
Module: addrs.RootModule.Child("foo"),
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -55,11 +55,11 @@ func TestProviderAddrs(t *testing.T) {
|
||||||
got := plan.ProviderAddrs()
|
got := plan.ProviderAddrs()
|
||||||
want := []addrs.AbsProviderConfig{
|
want := []addrs.AbsProviderConfig{
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance.Child("foo", addrs.NoKey),
|
Module: addrs.RootModule.Child("foo"),
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ func TestTFPlanRoundTrip(t *testing.T) {
|
||||||
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewDefaultProvider("test"),
|
Provider: addrs.NewDefaultProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
ChangeSrc: plans.ChangeSrc{
|
ChangeSrc: plans.ChangeSrc{
|
||||||
Action: plans.DeleteThenCreate,
|
Action: plans.DeleteThenCreate,
|
||||||
|
@ -79,7 +79,7 @@ func TestTFPlanRoundTrip(t *testing.T) {
|
||||||
DeposedKey: "foodface",
|
DeposedKey: "foodface",
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewDefaultProvider("test"),
|
Provider: addrs.NewDefaultProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
ChangeSrc: plans.ChangeSrc{
|
ChangeSrc: plans.ChangeSrc{
|
||||||
Action: plans.Delete,
|
Action: plans.Delete,
|
||||||
|
@ -198,7 +198,7 @@ func TestTFPlanRoundTripDestroy(t *testing.T) {
|
||||||
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
|
||||||
ProviderAddr: addrs.AbsProviderConfig{
|
ProviderAddr: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewDefaultProvider("test"),
|
Provider: addrs.NewDefaultProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
ChangeSrc: plans.ChangeSrc{
|
ChangeSrc: plans.ChangeSrc{
|
||||||
Action: plans.Delete,
|
Action: plans.Delete,
|
||||||
|
|
|
@ -11,24 +11,24 @@ import (
|
||||||
func TestAddressedTypesAbs(t *testing.T) {
|
func TestAddressedTypesAbs(t *testing.T) {
|
||||||
providerAddrs := []addrs.AbsProviderConfig{
|
providerAddrs := []addrs.AbsProviderConfig{
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
Provider: addrs.NewLegacyProvider("aws"),
|
Provider: addrs.NewLegacyProvider("aws"),
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
Provider: addrs.NewLegacyProvider("aws"),
|
Provider: addrs.NewLegacyProvider("aws"),
|
||||||
Alias: "foo",
|
Alias: "foo",
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
Provider: addrs.NewLegacyProvider("azure"),
|
Provider: addrs.NewLegacyProvider("azure"),
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
Provider: addrs.NewLegacyProvider("null"),
|
Provider: addrs.NewLegacyProvider("null"),
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
Provider: addrs.NewLegacyProvider("null"),
|
Provider: addrs.NewLegacyProvider("null"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ func TestSession_basicState(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
s.SetResourceInstanceCurrent(
|
s.SetResourceInstanceCurrent(
|
||||||
|
@ -62,7 +62,7 @@ func TestSession_basicState(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewLegacyProvider("test"),
|
Provider: addrs.NewLegacyProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -37,7 +37,7 @@ func TestState(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewDefaultProvider("test"),
|
Provider: addrs.NewDefaultProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ func TestState(t *testing.T) {
|
||||||
},
|
},
|
||||||
ProviderConfig: addrs.AbsProviderConfig{
|
ProviderConfig: addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewDefaultProvider("test"),
|
Provider: addrs.NewDefaultProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -144,7 +144,7 @@ func TestStateDeepCopy(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewDefaultProvider("test"),
|
Provider: addrs.NewDefaultProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
rootModule.SetResourceInstanceCurrent(
|
rootModule.SetResourceInstanceCurrent(
|
||||||
|
@ -171,7 +171,7 @@ func TestStateDeepCopy(t *testing.T) {
|
||||||
},
|
},
|
||||||
addrs.AbsProviderConfig{
|
addrs.AbsProviderConfig{
|
||||||
Provider: addrs.NewDefaultProvider("test"),
|
Provider: addrs.NewDefaultProvider("test"),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ func TestFullInitialState() *states.State {
|
||||||
}
|
}
|
||||||
providerAddr := addrs.AbsProviderConfig{
|
providerAddr := addrs.AbsProviderConfig{
|
||||||
Provider: rAddr.DefaultProvider(),
|
Provider: rAddr.DefaultProvider(),
|
||||||
Module: addrs.RootModuleInstance,
|
Module: addrs.RootModule,
|
||||||
}
|
}
|
||||||
childMod.SetResourceMeta(rAddr, states.EachList, providerAddr)
|
childMod.SetResourceMeta(rAddr, states.EachList, providerAddr)
|
||||||
return state
|
return state
|
||||||
|
|
Loading…
Reference in New Issue