state

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package state manages terraform state.

Index

Constants

View Source
const (
	DefaultStateVersion = 4
)

Variables

This section is empty.

Functions

func NewService

func NewService(opts ServiceOptions) *service

Types

type Client

type Client struct {
	otf.JSONAPIClient
}

Client uses json-api according to the documented terraform cloud state version API [1] that OTF implements (we could use something different, something simpler but since the terraform CLI talks to OTF via json-api we might as well use this too...).

[1] https://developer.hashicorp.com/terraform/cloud-docs/api-docs/state-versions#state-versions-api

func (*Client) CreateStateVersion

func (c *Client) CreateStateVersion(ctx context.Context, opts otf.CreateStateVersionOptions) error

func (*Client) DownloadCurrentState

func (c *Client) DownloadCurrentState(ctx context.Context, workspaceID string) ([]byte, error)

type ServiceOptions

type ServiceOptions struct {
	otf.Authorizer
	otf.Database
	otf.Cache
	logr.Logger
}

type State

type State struct {
	Version int
	Serial  int64
	Lineage string
	Outputs map[string]StateOutput
}

State is terraform state i.e. the state file

type StateOutput

type StateOutput struct {
	Name      string
	Value     string
	Type      string
	Sensitive bool
}

StateOutput is a terraform state output.

Jump to

Keyboard shortcuts

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