drift

package
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	// CheckDrift checks the drift of all resources in the blueprint
	// with the given instance ID.
	// This will always check the drift with the upstream provider,
	// the state container can be used to retrieve the last known
	// drift state that was previously checked.
	// In most cases, this method will persist the results of the
	// drift check with the configured state container.
	// This returns a map of resource IDs to their drift state ONLY
	// if the resource has drifted from the last known state.
	CheckDrift(
		ctx context.Context,
		instanceID string,
		params core.BlueprintParams,
	) (map[string]*state.ResourceDriftState, error)
	// CheckResourceDrift checks the drift of a single resource
	// with the given instance ID and resource ID.
	// This will always check the drift with the upstream provider,
	// the state container can be used to retrieve the last known
	// drift state that was previously checked.
	// In most cases, this method will persist the results of the
	// drift check with the configured state container.
	// This will return nil if the resource has not drifted from
	// the last known state.
	CheckResourceDrift(
		ctx context.Context,
		instanceID string,
		instanceName string,
		resourceID string,
		params core.BlueprintParams,
	) (*state.ResourceDriftState, error)
}

Checker is an interface for behaviour that can be used to check if resources within a blueprint have drifted from the current state persisted with the blueprint framework. This is useful to detect situations where resources in an upstream provider (e.g. an AWS account) have been modified manually or by other means, and the blueprint state is no longer in sync with the actual state of the resources. A checker is only responsible for checking and persisting drift, the course of action to resolve the drift is left to the user.

func NewDefaultChecker

func NewDefaultChecker(
	stateContainer state.Container,
	providers map[string]provider.Provider,
	changeGenerator changes.ResourceChangeGenerator,
	clock core.Clock,
	logger core.Logger,
) Checker

NewDefaultChecker creates a new instance of the default drift checker implementation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL