statemigration

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {

	// AWSAccessKeyID is an AWS access key id.
	AWSAccessKeyID string `required:"false"`

	// AWSSecretAccessKey is an AWS secret access key.
	AWSSecretAccessKey string `required:"false"`

	// GoogleApplicationCredentials is a set of Google Default Application Credentials.
	GoogleApplicationCredentials string `required:"false"`

	// IsApply is a Boolean of whether to run `tfmigrate apply` ("true") or
	// `tfmigrate plan` ("false") for the migrations.
	IsApply bool `required:"true"`

	// WorkspaceDirectories is a list of strings. Each string is relative file path to a directory
	// which is tied to a single Terraform Cloud workspace.
	WorkspaceDirectories []string `required:"true"`
}

Config contains environment variables needed to run StateMigrator methods.

func NewConfig

func NewConfig() (*Config, error)

type StateMigrator

type StateMigrator interface {

	// MigrateAllWorkspaces runs migrations for all workspaces by coordinating calls to MigrateWorkspace.
	MigrateAllWorkspaces() error

	// MigrateWorkspace runs migrations for the workspace specified.
	MigrateWorkspace(w Workspace) error
}

StateMigrator interface for running Terraform state migrations.

func NewStateMigrator

func NewStateMigrator(conf *Config) StateMigrator

NewStateMigrator instantiates a new implementation of the StateMigrator interface.

type Workspace

type Workspace string

Workspace is a relative path to a directory that corresponds to a single Terraform workspace.

Jump to

Keyboard shortcuts

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