drift

package
v0.15.10 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConfig

type BaseConfig struct {
	WildProvider *ProviderConfig
	Providers    []*ProviderConfig `hcl:"provider,block"`
}

type Drift

type Drift struct {
	// contains filtered or unexported fields
}

func New

func New(logger hclog.Logger) *Drift

func (*Drift) Configure

func (d *Drift) Configure(ctx context.Context, config hcl.Body) error

func (*Drift) Execute

func (*Drift) ID

func (d *Drift) ID() string

type IACConfig

type IACConfig struct {
	Type string `hcl:"type,optional"`

	AttributeMap []string `hcl:"attribute_map,optional"`
	// contains filtered or unexported fields
}

type Parser

type Parser struct {
	HCLContext *hcl.EvalContext
	// contains filtered or unexported fields
}

func NewParser

func NewParser(basePath string) *Parser

func (*Parser) Decode

func (p *Parser) Decode(body hcl.Body, diags hcl.Diagnostics) (*BaseConfig, hcl.Diagnostics)

type ProviderConfig

type ProviderConfig struct {
	WildResource *ResourceConfig

	Name          string                     `hcl:"name,label"`
	Resources     map[string]*ResourceConfig `hcl:"resource,block"`
	Version       string                     `hcl:"version,optional"`
	SkipResources []string                   `hcl:"skip_resources,optional"`
	// contains filtered or unexported fields
}

type Resource

type Resource struct {
	ID string `json:"id"`
}

type ResourceConfig

type ResourceConfig struct {
	Identifiers       []string `hcl:"identifiers,optional"`
	IgnoreIdentifiers []string `hcl:"ignore_identifiers,optional"`
	Attributes        []string `hcl:"attributes,optional"`
	IgnoreAttributes  []string `hcl:"ignore_attributes,optional"`
	Deep              *bool    `hcl:"deep,optional"`    // Check attributes if true, otherwise just match identifiers
	Filters           []string `hcl:"filters,optional"` // SQL filters to exclude cloud providers default resources

	IAC map[string]*IACConfig
	// contains filtered or unexported fields
}

type ResourceList

type ResourceList []*Resource

func (ResourceList) IDs

func (r ResourceList) IDs(exclude ...*Resource) []string

type Result

type Result struct {
	IAC          string `json:"iac"`
	Provider     string `json:"provider"`
	ResourceType string `json:"resource_type"`

	// Deep mode
	Different ResourceList `json:"diff,omitempty"`       // Resources don't match fully (id + attributes don't match)
	DeepEqual ResourceList `json:"deep_equal,omitempty"` // Resource exists in both places (attributes match)

	// Shallow mode
	Equal ResourceList `json:"equal,omitempty"` // Resource exists in both places (attributes not checked)

	// Both modes
	Missing ResourceList `json:"missing"` // Missing in cloud provider, defined in iac
	Extra   ResourceList `json:"extra"`   // Exists in cloud provider, not defined in iac

	// Options
	ListManaged bool `json:"-"` // Show or hide Equal/DeepEqual output
	Debug       bool `json:"-"` // Print debug output regarding results
}

func (*Result) String

func (r *Result) String() string

type Results

type Results []*Result

func (Results) String

func (rs Results) String() string

type RunParams

type RunParams struct {
	Debug bool

	TfMode, TfProvider         string
	ForceDeep                  bool
	ListManaged                bool
	TfBackendNames, AccountIDs []string
}

Jump to

Keyboard shortcuts

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