terraform: target at the right moment to get the right values
This commit is contained in:
parent
bb9820cc0b
commit
1efdba9b30
|
@ -5121,8 +5121,10 @@ func TestContext2Apply_targetedModuleDep(t *testing.T) {
|
|||
Targets: []string{"aws_instance.foo"},
|
||||
})
|
||||
|
||||
if _, err := ctx.Plan(); err != nil {
|
||||
if p, err := ctx.Plan(); err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
} else {
|
||||
t.Logf("Diff: %s", p)
|
||||
}
|
||||
|
||||
state, err := ctx.Apply()
|
||||
|
|
|
@ -81,15 +81,19 @@ func (b *PlanGraphBuilder) Steps() []GraphTransformer {
|
|||
Module: b.Module,
|
||||
},
|
||||
|
||||
// Target
|
||||
&TargetsTransformer{Targets: b.Targets},
|
||||
|
||||
// Attach the configuration to any resources
|
||||
&AttachResourceConfigTransformer{Module: b.Module},
|
||||
|
||||
// Attach the state
|
||||
&AttachStateTransformer{State: b.State},
|
||||
|
||||
// Connect so that the references are ready for targeting. We'll
|
||||
// have to connect again later for providers and so on.
|
||||
&ReferenceTransformer{},
|
||||
|
||||
// Target
|
||||
&TargetsTransformer{Targets: b.Targets},
|
||||
|
||||
// Create all the providers
|
||||
&MissingProviderTransformer{Providers: b.Providers, Factory: providerFactory},
|
||||
&ProviderTransformer{},
|
||||
|
@ -103,7 +107,8 @@ func (b *PlanGraphBuilder) Steps() []GraphTransformer {
|
|||
// Add module variables
|
||||
&ModuleVariableTransformer{Module: b.Module},
|
||||
|
||||
// Connect references so ordering is correct
|
||||
// Connect references again to connect the providers, module variables,
|
||||
// etc. This is idempotent.
|
||||
&ReferenceTransformer{},
|
||||
|
||||
// Single root
|
||||
|
|
Loading…
Reference in New Issue