Documentation ¶
Overview ¶
Package edit contains functions suitable for editing a snapshot in-place. It is designed to be used by higher-level tools that present a means for users to surgically edit their state.
Index ¶
- func DeleteResource(snapshot *deploy.Snapshot, condemnedRes *resource.State) error
- func LocateResource(snap *deploy.Snapshot, urn resource.URN) []*resource.State
- func UnprotectResource(_ *deploy.Snapshot, res *resource.State) error
- type OperationFunc
- type ResourceHasDependenciesError
- type ResourceProtectedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteResource ¶
DeleteResource deletes a given resource from the snapshot, if it is possible to do so. A resource can only be deleted from a stack if there do not exist any resources that depend on it or descend from it. If such a resource does exist, DeleteResource will return an error instance of `ResourceHasDependenciesError`.
func LocateResource ¶
LocateResource returns all resources in the given shapshot that have the given URN.
Types ¶
type OperationFunc ¶
OperationFunc is the type of functions that edit resources within a snapshot. The edits are made in-place to the given snapshot and pertain to the specific passed-in resource.
type ResourceHasDependenciesError ¶
type ResourceHasDependenciesError struct { Condemned *resource.State Dependencies []*resource.State }
ResourceHasDependenciesError is returned by DeleteResource if a resource can't be deleted due to the presence of resources that depend directly or indirectly upon it.
func (ResourceHasDependenciesError) Error ¶
func (r ResourceHasDependenciesError) Error() string
type ResourceProtectedError ¶
ResourceProtectedError is returned by DeleteResource if a resource is protected.
func (ResourceProtectedError) Error ¶
func (ResourceProtectedError) Error() string