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 ¶
View Source
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 ¶
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 UnpackTerraform ¶
UnpackTerraform unpacks the terraform binary and the specified provider binaries into the specified directory.
Types ¶
type Stage ¶
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.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.