remote

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_PATH_TO_LOCAL_STATE_FILE = "terraform.tfstate"

When storing Terraform state locally, this is the default path to the tfstate file

View Source
const DEFAULT_PATH_TO_REMOTE_STATE_FILE = ".terraform/terraform.tfstate"

When using remote state storage, Terraform keeps a local copy of the state file in this folder

View Source
const MAX_RETRIES_WAITING_FOR_S3_BUCKET = 12
View Source
const SLEEP_BETWEEN_RETRIES_WAITING_FOR_S3_BUCKET = 5 * time.Second

Variables

View Source
var RemoteBackendMissing = fmt.Errorf("The remoteState.backend field cannot be empty")

Functions

func CreateS3Bucket added in v0.2.0

func CreateS3Bucket(s3Client *s3.S3, config *RemoteStateConfigS3) error

Create the S3 bucket specified in the given config

func CreateS3BucketWithVersioning added in v0.2.0

func CreateS3BucketWithVersioning(s3Client *s3.S3, config *RemoteStateConfigS3) error

Create the given S3 bucket and enable versioning for it

func CreateS3Client added in v0.2.0

func CreateS3Client(awsRegion string) (*s3.S3, error)

Create an authenticated client for DynamoDB

func DoesS3BucketExist added in v0.2.0

func DoesS3BucketExist(s3Client *s3.S3, config *RemoteStateConfigS3) bool

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

func EnableVersioningForS3Bucket added in v0.2.0

func EnableVersioningForS3Bucket(s3Client *s3.S3, config *RemoteStateConfigS3) error

Enable versioning for the S3 bucket specified in the given config

func InitializeRemoteStateS3 added in v0.2.0

func InitializeRemoteStateS3(config map[string]string, terragruntOptions *options.TerragruntOptions) error

Initialize the remote state S3 bucket specified in the given config. This function will validate the config parameters, create the S3 bucket if it doesn't already exist, and check that versioning is enabled.

func WaitUntilS3BucketExists added in v0.4.0

func WaitUntilS3BucketExists(s3Client *s3.S3, config *RemoteStateConfigS3) error

AWS is eventually consistent, so after creating an S3 bucket, this method can be used to wait until the information about that S3 bucket has propagated everywhere

Types

type CantParseTerraformStateFile

type CantParseTerraformStateFile struct {
	Path          string
	UnderlyingErr error
}

func (CantParseTerraformStateFile) Error

func (err CantParseTerraformStateFile) Error() string

type MaxRetriesWaitingForS3BucketExceeded added in v0.4.0

type MaxRetriesWaitingForS3BucketExceeded string

func (MaxRetriesWaitingForS3BucketExceeded) Error added in v0.4.0

type MissingRequiredS3RemoteStateConfig added in v0.2.0

type MissingRequiredS3RemoteStateConfig string

func (MissingRequiredS3RemoteStateConfig) Error added in v0.2.0

func (configName MissingRequiredS3RemoteStateConfig) Error() string

type RemoteState

type RemoteState struct {
	Backend string            `hcl:"backend"`
	Config  map[string]string `hcl:"config"`
}

Configuration for Terraform remote state

func (RemoteState) ConfigureRemoteState

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

Configure Terraform remote state

func (*RemoteState) FillDefaults

func (remoteState *RemoteState) FillDefaults()

Fill in any default configuration for remote state

func (*RemoteState) Initialize added in v0.2.0

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

Perform 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 (*RemoteState) Validate

func (remoteState *RemoteState) Validate() error

Validate that the remote state is configured correctly

type RemoteStateConfigS3 added in v0.2.0

type RemoteStateConfigS3 struct {
	Encrypt string
	Bucket  string
	Key     string
	Region  string
}

A representation of the configuration options available for S3 remote state

type RemoteStateInitializer added in v0.2.0

type RemoteStateInitializer func(map[string]string, *options.TerragruntOptions) error

type TerraformState

type TerraformState struct {
	Version int
	Serial  int
	Remote  *TerraformStateRemote
	Modules []TerraformStateModule
}

The structure of the Terraform .tfstate file

func ParseTerraformStateFile

func ParseTerraformStateFile(path string) (*TerraformState, error)

Parse the Terraform .tfstate file at the given path

func ParseTerraformStateFileFromDefaultLocations

func ParseTerraformStateFileFromDefaultLocations() (*TerraformState, error)

Parse the Terraform .tfstate file from its default locations. If the file doesn't exist at any of the default locations, return nil.

func (*TerraformState) IsRemote

func (state *TerraformState) IsRemote() bool

Return true if this Terraform state is configured for remote state storage

type TerraformStateModule

type TerraformStateModule struct {
	Path      []string
	Outputs   map[string]interface{}
	Resources map[string]interface{}
}

The structure of a "module" section of the Terraform .tfstate file

type TerraformStateRemote

type TerraformStateRemote struct {
	Type   string
	Config map[string]string
}

The structure of the "remote" section of the Terraform .tfstate file

Jump to

Keyboard shortcuts

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