add CreateBeforeDestroy to state
Added to src and object, but still need serialization and tests.
This commit is contained in:
parent
ded207f3b8
commit
dd8ab5812e
|
@ -36,6 +36,13 @@ type ResourceInstanceObject struct {
|
|||
// altogether, or is now deposed.
|
||||
Dependencies []addrs.AbsResource
|
||||
|
||||
// CreateBeforeDestroy reflects the status of the lifecycle
|
||||
// create_before_destroy option when this instance was last updated.
|
||||
// Because create_before_destroy also effects the overall ordering of the
|
||||
// destroy operations, we need to record the status to ensure a resource
|
||||
// removed from the config will still be destroyed in the same manner.
|
||||
CreateBeforeDestroy bool
|
||||
|
||||
// DependsOn corresponds to the deprecated `depends_on` field in the state.
|
||||
// This field contained the configuration `depends_on` values, and some of
|
||||
// the references from within a single module.
|
||||
|
|
|
@ -54,6 +54,7 @@ type ResourceInstanceObjectSrc struct {
|
|||
Private []byte
|
||||
Status ObjectStatus
|
||||
Dependencies []addrs.AbsResource
|
||||
CreateBeforeDestroy bool
|
||||
// deprecated
|
||||
DependsOn []addrs.Referenceable
|
||||
}
|
||||
|
@ -90,6 +91,7 @@ func (os *ResourceInstanceObjectSrc) Decode(ty cty.Type) (*ResourceInstanceObjec
|
|||
Dependencies: os.Dependencies,
|
||||
DependsOn: os.DependsOn,
|
||||
Private: os.Private,
|
||||
CreateBeforeDestroy: os.CreateBeforeDestroy,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -173,6 +173,7 @@ func (obj *ResourceInstanceObjectSrc) DeepCopy() *ResourceInstanceObjectSrc {
|
|||
AttrsJSON: attrsJSON,
|
||||
Dependencies: dependencies,
|
||||
DependsOn: dependsOn,
|
||||
CreateBeforeDestroy: obj.CreateBeforeDestroy,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue