terraform

package
v0.0.0-...-6df56f3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOutputsValuesFromStateFile

func GetOutputsValuesFromStateFile(file *statefile.File) map[string]*states.OutputValue

Types

type OutputStatus

type OutputStatus struct {
	// Attribute name in module
	// +optional
	Key string `json:"key"`
	// Value
	// +optional
	Value string `json:"value"`
}

OutputStatus outputs the values of Terraform output

func GetOutputsFromStateFile

func GetOutputsFromStateFile(file *statefile.File) ([]*OutputStatus, error)

type RemoteStateConnector

type RemoteStateConnector interface {
	Download() ([]byte, error)
	DownloadAsStatefile() (*statefile.File, []byte, error)
}

func NewDefaultS3RemoteStateConnector

func NewDefaultS3RemoteStateConnector(bucket, key, region string) RemoteStateConnector

func NewS3RemoteStateConnector

func NewS3RemoteStateConnector(s3api *awsclient.S3Api, bucket, key, region string) RemoteStateConnector

type S3RemoteStateConnector

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

func (*S3RemoteStateConnector) Download

func (sc *S3RemoteStateConnector) Download() ([]byte, error)

func (*S3RemoteStateConnector) DownloadAsStatefile

func (sc *S3RemoteStateConnector) DownloadAsStatefile() (*statefile.File, []byte, error)

type S3StateStorage

type S3StateStorage struct {
	Bucket string `yaml:"bucket"`
	Region string `yaml:"region"`
}

type SourceInput

type SourceInput struct {
	StorageType StateStorageType `yaml:"storageType"`
	S3Storage   *S3StateStorage  `yaml:"-"`
	Value       StateValueInput  `yaml:"value"`
}

func (*SourceInput) UnmarshalYAML

func (s *SourceInput) UnmarshalYAML(n *yaml.Node) error

type StateStorageType

type StateStorageType string
const (
	S3Storage StateStorageType = "s3"
)

type StateValueInput

type StateValueInput struct {
	Key            string `yaml:"key"`
	StateValuePath string `yaml:"stateValuePath"`
}

type TFClient

type TFClient interface {
	GetState(connector RemoteStateConnector) (*TFState, error)
}

func NewTerraformClient

func NewTerraformClient() TFClient

type TFState

type TFState struct {
	File *statefile.File
	Raw  []byte
}

func NewStateFromFile

func NewStateFromFile(File *statefile.File, raw []byte) *TFState

func (*TFState) ListAllResources

func (s *TFState) ListAllResources() []string

example data.terraform_remote_state.my_important_state\ aws_security_group_rule.my_sg module.mod-name.module.internal-mod-name.datadog_monitor.my_dd_alert

func (*TFState) ListModulesAddrs

func (s *TFState) ListModulesAddrs() []string

returns all addresses of modules including full addresses of internal nested modules of other modules list include empty string as well which is the root module. i.e resources inside the state with no actual module module.A module.B module.A.module.C module.B.module.D

func (*TFState) OutputsStatus

func (s *TFState) OutputsStatus() ([]*OutputStatus, error)

type TerraformClient

type TerraformClient struct {
}

func (*TerraformClient) GetState

func (tc *TerraformClient) GetState(connector RemoteStateConnector) (*TFState, error)

Jump to

Keyboard shortcuts

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