finish provider ModuleInstance replacement

This commit is contained in:
James Bardin 2020-03-11 14:19:52 -04:00
parent 98cfb51f27
commit e13eecbc5b
27 changed files with 124 additions and 124 deletions

View File

@ -217,7 +217,7 @@ func TestLocal_planDeposedOnly(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
}))
@ -661,7 +661,7 @@ func testPlanState() *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
return state
@ -688,7 +688,7 @@ func testPlanState_withDataSource() *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
rootModule.SetResourceInstanceCurrent(
@ -705,7 +705,7 @@ func testPlanState_withDataSource() *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
return state
@ -732,7 +732,7 @@ func testPlanState_tainted() *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
return state

View File

@ -152,7 +152,7 @@ func TestBackendStates(t *testing.T, b Backend) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)

View File

@ -31,7 +31,7 @@ func TestApply_destroy(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -127,7 +127,7 @@ func TestApply_destroyLockedState(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -202,7 +202,7 @@ func TestApply_destroyTargeted(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -218,7 +218,7 @@ func TestApply_destroyTargeted(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})

View File

@ -835,7 +835,7 @@ func TestApply_refresh(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -992,7 +992,7 @@ func TestApply_state(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -1359,7 +1359,7 @@ func TestApply_backup(t *testing.T) {
},
addrs.AbsProviderConfig{
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),
ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
ChangeSrc: plans.ChangeSrc{
Action: plans.Create,

View File

@ -273,7 +273,7 @@ func testState() *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
// DeepCopy is used here to ensure our synthetic state matches exactly

View File

@ -3159,7 +3159,7 @@ func runTestCases(t *testing.T, testCases map[string]testCase) {
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
ChangeSrc: plans.ChangeSrc{
Action: tc.Action,

View File

@ -245,7 +245,7 @@ func basicState(t *testing.T) *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
rootModule.SetResourceInstanceCurrent(
@ -261,7 +261,7 @@ func basicState(t *testing.T) *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
return state
@ -297,7 +297,7 @@ func stateWithMoreOutputs(t *testing.T) *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
return state
@ -324,7 +324,7 @@ func nestedState(t *testing.T) *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
return state
@ -347,7 +347,7 @@ func deposedState(t *testing.T) *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
return state
@ -376,7 +376,7 @@ func onlyDeposedState(t *testing.T) *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
rootModule.SetResourceInstanceDeposed(
@ -393,7 +393,7 @@ func onlyDeposedState(t *testing.T) *states.State {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
return state

View File

@ -127,7 +127,7 @@ func TestGraph_plan(t *testing.T) {
},
ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
})
emptyConfig, err := plans.NewDynamicValue(cty.EmptyObjectVal, cty.EmptyObject)

View File

@ -260,7 +260,7 @@ func TestMarshalPlanResources(t *testing.T) {
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
ChangeSrc: plans.ChangeSrc{
Action: test.Action,

View File

@ -203,7 +203,7 @@ func TestMarshalResources(t *testing.T) {
},
ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
},
},
@ -245,7 +245,7 @@ func TestMarshalResources(t *testing.T) {
},
ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
},
},
@ -287,7 +287,7 @@ func TestMarshalResources(t *testing.T) {
},
ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
},
},
@ -331,7 +331,7 @@ func TestMarshalResources(t *testing.T) {
},
ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
},
},
@ -380,7 +380,7 @@ func TestMarshalResources(t *testing.T) {
},
ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
},
},
@ -452,7 +452,7 @@ func TestMarshalModules_basic(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -467,7 +467,7 @@ func TestMarshalModules_basic(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: childModule,
Module: childModule.Module(),
},
)
s.SetResourceInstanceCurrent(
@ -482,7 +482,7 @@ func TestMarshalModules_basic(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: subModule,
Module: subModule.Module(),
},
)
})
@ -521,7 +521,7 @@ func TestMarshalModules_nested(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -536,7 +536,7 @@ func TestMarshalModules_nested(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: childModule,
Module: childModule.Module(),
},
)
s.SetResourceInstanceCurrent(
@ -551,7 +551,7 @@ func TestMarshalModules_nested(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: subModule,
Module: subModule.Module(),
},
)
})

View File

@ -126,7 +126,7 @@ func TestPlan_destroy(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -245,7 +245,7 @@ func TestPlan_outPathNoChange(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})

View File

@ -487,7 +487,7 @@ func showFixturePlanFile(t *testing.T, action plans.Action) string {
}.Instance(addrs.NoKey).Absolute(addrs.RootModuleInstance),
ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
ChangeSrc: plans.ChangeSrc{
Action: action,

View File

@ -29,7 +29,7 @@ func TestStateMv(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -45,7 +45,7 @@ func TestStateMv(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -160,7 +160,7 @@ func TestStateMv_resourceToInstance(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -176,7 +176,7 @@ func TestStateMv_resourceToInstance(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceMeta(
@ -188,7 +188,7 @@ func TestStateMv_resourceToInstance(t *testing.T) {
states.EachList,
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -250,7 +250,7 @@ func TestStateMv_instanceToResource(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -265,7 +265,7 @@ func TestStateMv_instanceToResource(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -338,7 +338,7 @@ func TestStateMv_instanceToNewResource(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -409,7 +409,7 @@ func TestStateMv_differentResourceTypes(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -462,7 +462,7 @@ func TestStateMv_explicitWithBackend(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -477,7 +477,7 @@ func TestStateMv_explicitWithBackend(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -537,7 +537,7 @@ func TestStateMv_backupExplicit(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -553,7 +553,7 @@ func TestStateMv_backupExplicit(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -602,7 +602,7 @@ func TestStateMv_stateOutNew(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -656,7 +656,7 @@ func TestStateMv_stateOutExisting(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -675,7 +675,7 @@ func TestStateMv_stateOutExisting(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -755,7 +755,7 @@ func TestStateMv_stateOutNew_count(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -770,7 +770,7 @@ func TestStateMv_stateOutNew_count(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -785,7 +785,7 @@ func TestStateMv_stateOutNew_count(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -843,7 +843,7 @@ func TestStateMv_stateOutNew_largeCount(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
}
@ -859,7 +859,7 @@ func TestStateMv_stateOutNew_largeCount(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -913,7 +913,7 @@ func TestStateMv_stateOutNew_nestedModule(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -928,7 +928,7 @@ func TestStateMv_stateOutNew_nestedModule(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -983,7 +983,7 @@ func TestStateMv_toNewModule(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -1056,7 +1056,7 @@ func TestStateMv_withinBackend(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -1072,7 +1072,7 @@ func TestStateMv_withinBackend(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})

View File

@ -27,7 +27,7 @@ func TestStateRm(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -42,7 +42,7 @@ func TestStateRm(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -92,7 +92,7 @@ func TestStateRmNotChildModule(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
// This second instance has the same local address as the first but
@ -110,7 +110,7 @@ func TestStateRmNotChildModule(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -181,7 +181,7 @@ func TestStateRmNoArgs(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -196,7 +196,7 @@ func TestStateRmNoArgs(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -240,7 +240,7 @@ func TestStateRmNonExist(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -255,7 +255,7 @@ func TestStateRmNonExist(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -300,7 +300,7 @@ func TestStateRm_backupExplicit(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -315,7 +315,7 @@ func TestStateRm_backupExplicit(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -416,7 +416,7 @@ func TestStateRm_backendState(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -431,7 +431,7 @@ func TestStateRm_backendState(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})

View File

@ -120,7 +120,7 @@ func (c *StateShowCommand) Run(args []string) int {
absPc := addrs.AbsProviderConfig{
Provider: rs.ProviderConfig.Provider,
Alias: rs.ProviderConfig.Alias,
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
}
singleInstance := states.NewState()
singleInstance.EnsureModule(addr.Module).SetResourceInstanceCurrent(

View File

@ -27,7 +27,7 @@ func TestStateShow(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -85,7 +85,7 @@ func TestStateShow_multi(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -100,7 +100,7 @@ func TestStateShow_multi(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: submod,
Module: submod.Module(),
},
)
})
@ -206,7 +206,7 @@ func TestStateShow_configured_provider(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test-beta"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})

View File

@ -26,7 +26,7 @@ func TestTaint(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -64,7 +64,7 @@ func TestTaint_lockedState(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -253,7 +253,7 @@ func TestTaint_missing(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -289,7 +289,7 @@ func TestTaint_missingAllow(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -368,7 +368,7 @@ func TestTaint_module(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -383,7 +383,7 @@ func TestTaint_module(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})

View File

@ -25,7 +25,7 @@ func TestUntaint(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -68,7 +68,7 @@ func TestUntaint_lockedState(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -279,7 +279,7 @@ func TestUntaint_missing(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -315,7 +315,7 @@ func TestUntaint_missingAllow(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})
@ -403,7 +403,7 @@ func TestUntaint_module(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -418,7 +418,7 @@ func TestUntaint_module(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})

View File

@ -243,7 +243,7 @@ func TestWorkspace_createWithState(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})

View File

@ -43,7 +43,7 @@ func TestStateShim(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
rootModule.SetResourceInstanceCurrent(
@ -59,7 +59,7 @@ func TestStateShim(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
@ -78,7 +78,7 @@ func TestStateShim(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: childInstance,
Module: childInstance.Module(),
},
)
childModule.SetResourceInstanceCurrent(
@ -102,7 +102,7 @@ func TestStateShim(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: childInstance,
Module: childInstance.Module(),
},
)
@ -128,7 +128,7 @@ func TestStateShim(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: childInstance,
Module: childInstance.Module(),
},
)
@ -145,7 +145,7 @@ func TestStateShim(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: childInstance,
Module: childInstance.Module(),
},
)
childModule.SetResourceInstanceCurrent(
@ -161,7 +161,7 @@ func TestStateShim(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: childInstance,
Module: childInstance.Module(),
},
)
@ -178,7 +178,7 @@ func TestStateShim(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: childInstance,
Module: childInstance.Module(),
},
)

View File

@ -729,7 +729,7 @@ func testIDOnlyRefresh(c TestCase, opts terraform.ContextOpts, step TestStep, r
},
addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("placeholder"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)

View File

@ -21,7 +21,7 @@ func TestProviderAddrs(t *testing.T) {
Name: "woot",
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
ProviderAddr: addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
Provider: addrs.NewLegacyProvider("test"),
},
},
@ -33,7 +33,7 @@ func TestProviderAddrs(t *testing.T) {
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
DeposedKey: "foodface",
ProviderAddr: addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
Provider: addrs.NewLegacyProvider("test"),
},
},
@ -44,7 +44,7 @@ func TestProviderAddrs(t *testing.T) {
Name: "what",
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
ProviderAddr: addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance.Child("foo", addrs.NoKey),
Module: addrs.RootModule.Child("foo"),
Provider: addrs.NewLegacyProvider("test"),
},
},
@ -55,11 +55,11 @@ func TestProviderAddrs(t *testing.T) {
got := plan.ProviderAddrs()
want := []addrs.AbsProviderConfig{
addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance.Child("foo", addrs.NoKey),
Module: addrs.RootModule.Child("foo"),
Provider: addrs.NewLegacyProvider("test"),
},
addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
Provider: addrs.NewLegacyProvider("test"),
},
}

View File

@ -58,7 +58,7 @@ func TestTFPlanRoundTrip(t *testing.T) {
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
ChangeSrc: plans.ChangeSrc{
Action: plans.DeleteThenCreate,
@ -79,7 +79,7 @@ func TestTFPlanRoundTrip(t *testing.T) {
DeposedKey: "foodface",
ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
ChangeSrc: plans.ChangeSrc{
Action: plans.Delete,
@ -198,7 +198,7 @@ func TestTFPlanRoundTripDestroy(t *testing.T) {
}.Instance(addrs.IntKey(0)).Absolute(addrs.RootModuleInstance),
ProviderAddr: addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
ChangeSrc: plans.ChangeSrc{
Action: plans.Delete,

View File

@ -11,24 +11,24 @@ import (
func TestAddressedTypesAbs(t *testing.T) {
providerAddrs := []addrs.AbsProviderConfig{
addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
Provider: addrs.NewLegacyProvider("aws"),
},
addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
Provider: addrs.NewLegacyProvider("aws"),
Alias: "foo",
},
addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
Provider: addrs.NewLegacyProvider("azure"),
},
addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
Provider: addrs.NewLegacyProvider("null"),
},
addrs.AbsProviderConfig{
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
Provider: addrs.NewLegacyProvider("null"),
},
}

View File

@ -47,7 +47,7 @@ func TestSession_basicState(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
s.SetResourceInstanceCurrent(
@ -62,7 +62,7 @@ func TestSession_basicState(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewLegacyProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
})

View File

@ -37,7 +37,7 @@ func TestState(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
@ -81,7 +81,7 @@ func TestState(t *testing.T) {
},
ProviderConfig: addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
},
},
@ -144,7 +144,7 @@ func TestStateDeepCopy(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)
rootModule.SetResourceInstanceCurrent(
@ -171,7 +171,7 @@ func TestStateDeepCopy(t *testing.T) {
},
addrs.AbsProviderConfig{
Provider: addrs.NewDefaultProvider("test"),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
},
)

View File

@ -152,7 +152,7 @@ func TestFullInitialState() *states.State {
}
providerAddr := addrs.AbsProviderConfig{
Provider: rAddr.DefaultProvider(),
Module: addrs.RootModuleInstance,
Module: addrs.RootModule,
}
childMod.SetResourceMeta(rAddr, states.EachList, providerAddr)
return state