remote

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBackendMissing = fmt.Errorf("the remote_state.backend field cannot be empty")

ErrBackendMissing indicates that there is no backend configuration defined.

Functions

func CreateS3Client

func CreateS3Client(awsRegion, awsProfile string) (*s3.Client, error)

CreateS3Client creates an authenticated client for S3.

func DoesS3BucketExist

func DoesS3BucketExist(client *s3.Client, config *StateConfigS3) bool

DoesS3BucketExist returns true if the S3 bucket specified in the given config exists and the current user has the ability to access it.

Types

type State

type State struct {
	Backend string `hcl:"backend,optional"`
	Config  map[string]interface{}

	ConfigHclDefinition cty.Value `hcl:"config,optional"`
}

State is the configuration for Terraform remote state

func (State) ConfigureRemoteState

func (remoteState State) ConfigureRemoteState(terragruntOptions *options.TerragruntOptions) error

ConfigureRemoteState configures Terraform remote state

func (*State) Initialize

func (remoteState *State) Initialize(terragruntOptions *options.TerragruntOptions) error

Initialize performs any actions necessary to initialize the remote state before it's used for storage. For example, if you're using S3 for remote state storage, this may create the S3 bucket if it doesn't exist already.

func (*State) String

func (remoteState *State) String() string

func (State) ToTerraformInitArgs

func (remoteState State) ToTerraformInitArgs() []string

ToTerraformInitArgs converts the State config into the format used by the terraform init command

func (*State) Validate

func (remoteState *State) Validate() error

Validate that the remote state is configured correctly

type StateConfigS3

type StateConfigS3 struct {
	Encrypt   bool   `mapstructure:"encrypt"`
	Bucket    string `mapstructure:"bucket"`
	Key       string `mapstructure:"key"`
	Region    string `mapstructure:"region"`
	Profile   string `mapstructure:"profile"`
	LockTable string `mapstructure:"dynamodb_table"`
}

StateConfigS3 is a representation of the configuration options available for S3 remote state

type TerraformState

type TerraformState struct {
	Version int
	Serial  int
	Backend *terraformBackend
	Modules []terraformStateModule
}

TerraformState is the structure representing the Terraform .tfstate file

Jump to

Keyboard shortcuts

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