state

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package state provides primitives to list all resources and providers in a Terraform state file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

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

State represents a Terraform state.

func New

func New(path string) (*State, error)

New creates a state from a given path to a Terraform state file.

func (*State) ProviderNames

func (s *State) ProviderNames() []string

ProviderNames returns a list of all provider names (e.g., "aws", "google") in the state. The result of provider names is deduplicated.

func (*State) Resources

func (s *State) Resources(providers map[string]*provider.TerraformProvider) ([]resource.UpdatableResource, error)

Resources returns a list of resources in the state that are managed by one of the given providers.

Data sources are not returned as these are managed outside the scope of the state and therefore shouldn't be destroyed.

Jump to

Keyboard shortcuts

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