Documentation
¶
Overview ¶
Package terraform contains the utilities that's used for invoking terraform executable under the given directory with the given templates.
Index ¶
- Constants
- func Apply(dir string, platform string, stage Stage, terraformDir string, ...) error
- func Destroy(dir string, platform string, stage Stage, terraformDir string, ...) error
- func Outputs(dir string, terraformDir string) ([]byte, error)
- func UnpackTerraform(dir string, stages []Stage) error
- type Stage
Constants ¶
const StateFilename = "terraform.tfstate"
StateFilename is the default name of the terraform state file.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(dir string, platform string, stage Stage, terraformDir string, extraOpts ...tfexec.ApplyOption) error
Apply unpacks the platform-specific Terraform modules into the given directory and then runs 'terraform init' and 'terraform apply'.
func Destroy ¶ added in v0.3.0
func Destroy(dir string, platform string, stage Stage, terraformDir string, extraOpts ...tfexec.DestroyOption) error
Destroy unpacks the platform-specific Terraform modules into the given directory and then runs 'terraform init' and 'terraform destroy'.
func Outputs ¶ added in v0.4.15
Outputs reads the terraform state file and returns the outputs of the stage as json.
func UnpackTerraform ¶ added in v0.4.15
UnpackTerraform unpacks the terraform binary and the specified provider binaries into the specified directory.
Types ¶
type Stage ¶ added in v0.4.15
type Stage interface {
// Name is the name of the stage.
Name() string
// StateFilename is the name of the terraform state file.
StateFilename() string
// OutputsFilename is the name of the outputs file for the stage.
OutputsFilename() string
// Providers is the list of providers that are used for the stage.
Providers() []providers.Provider
// DestroyWithBootstrap is true if the stage should be destroyed when destroying the bootstrap resources.
DestroyWithBootstrap() bool
// Destroy destroys the resources created in the stage. This should only be called if the stage should be destroyed
// when destroying the bootstrap resources.
Destroy(directory string, terraformDir string, varFiles []string) error
// ExtractHostAddresses extracts the IPs of the bootstrap and control plane machines.
ExtractHostAddresses(directory string, config *types.InstallConfig) (bootstrap string, port int, masters []string, err error)
}
Stage is an individual stage of terraform infrastructure provisioning.