Add component address to ComponentInstance under AppliedChanges (#34418)

This commit is contained in:
Matej Risek 2023-12-15 15:30:11 +01:00 committed by GitHub
parent 2973d070b3
commit 039cced8ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 556 additions and 541 deletions

File diff suppressed because it is too large Load diff

View file

@ -906,6 +906,7 @@ message AppliedChange {
bool interim = 3;
}
message ComponentInstance {
string component_addr = 3;
string component_instance_addr = 1;
map<string,DynamicValue> output_values = 2;
}

View file

@ -1156,6 +1156,7 @@ func (c *ComponentInstance) CheckApply(ctx context.Context) ([]stackstate.Applie
newState := applyResult.FinalState
ourChange := &stackstate.AppliedChangeComponentInstance{
ComponentAddr: c.call.Addr(),
ComponentInstanceAddr: c.Addr(),
OutputValues: make(map[addrs.OutputValue]cty.Value, len(newState.RootOutputValues)),
}

View file

@ -166,6 +166,7 @@ func (ac *AppliedChangeResourceInstanceObject) protosForObject() ([]*terraform1.
// does not directly track any resource instances inside. Those are tracked
// using individual [AppliedChangeResourceInstanceObject] objects for each.
type AppliedChangeComponentInstance struct {
ComponentAddr stackaddrs.AbsComponent
ComponentInstanceAddr stackaddrs.AbsComponentInstance
// OutputValues "remembers" the output values from the most recent
@ -221,6 +222,7 @@ func (ac *AppliedChangeComponentInstance) AppliedChangeProto() (*terraform1.Appl
Key: statekeys.String(stateKey),
Description: &terraform1.AppliedChange_ChangeDescription_ComponentInstance{
ComponentInstance: &terraform1.AppliedChange_ComponentInstance{
ComponentAddr: ac.ComponentAddr.String(),
ComponentInstanceAddr: ac.ComponentInstanceAddr.String(),
},
},