Documentation ¶
Index ¶
- Variables
- func CreateS3Client(awsRegion, awsProfile string) (*s3.Client, error)
- func DoesS3BucketExist(client *s3.Client, config *StateConfigS3) bool
- type State
- func (remoteState State) ConfigureRemoteState(terragruntOptions *options.TerragruntOptions) error
- func (remoteState *State) Initialize(terragruntOptions *options.TerragruntOptions) error
- func (remoteState *State) String() string
- func (remoteState State) ToTerraformInitArgs() []string
- func (remoteState *State) Validate() error
- type StateConfigS3
- type TerraformState
Constants ¶
This section is empty.
Variables ¶
var ErrBackendMissing = fmt.Errorf("the remote_state.backend field cannot be empty")
ErrBackendMissing indicates that there is no backend configuration defined.
Functions ¶
func CreateS3Client ¶
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) ToTerraformInitArgs ¶
ToTerraformInitArgs converts the State config into the format used by the terraform init command
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