plugins_terraform

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CopyFile = CopyFileFunc

Functions

func CopyFileFunc

func CopyFileFunc(src, dst string) (err error)

CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherise, attempt to create a hard link between the two files. If that fail, copy the file contents from src to dst.

func GetTerraformCLIVars

func GetTerraformCLIVars(exec config.StepExecution) map[string]interface{}

func GetTerraformEnvVars

func GetTerraformEnvVars(exec config.StepExecution) map[string]string

func HandleDeployOverrides

func HandleDeployOverrides(logger *logrus.Entry, execDir string,
	deploymentRing string)

HandleDeployOverrides copy deploy override configurations into the execution working directory

func HandleDestroyOverrides

func HandleDestroyOverrides(logger *logrus.Entry, execDir string,
	deploymentRing string)

HandleDestroyOverrides copy destroy override configurations into the execution working directory

func KeysString

func KeysString(m map[string]config.Account) string

Types

type TFBackendParser

type TFBackendParser func(fs afero.Fs, log *logrus.Entry, file string) (backend TerraformBackend)

TFBackendParser is a function type that handles parsing a backend.tf file

type TFBackendType

type TFBackendType int

TFBackendType represents a Terraform backend type

const (
	// S3Backend backend
	S3Backend TFBackendType = iota
	// Azure Storage Account backend
	AzureStorageAccount
	// Google Cloud Storage backend
	GCSBackend
	// LocalBackend backend
	LocalBackend
	// UnknownBackend represents an unknown backend
	UnknownBackend
)

func StringToBackendType

func StringToBackendType(s string) (TFBackendType, error)

StringToBackendType converts a string to a ProviderType

func (TFBackendType) String

func (b TFBackendType) String() string

type TerraformBackend

type TerraformBackend struct {
	Type                  TFBackendType
	Key                   string
	S3RoleArn             string
	S3Bucket              string
	AZUResourceGroupName  string
	AZUStorageAccountName string
	GCSBucket             string
	GCSPrefix             string
	Path                  string
	Config                map[string]interface{}
}

TerraformBackend is a structure that represents a terraform backend file

func GetBackendConfig

func GetBackendConfig(exec config.StepExecution, backendParser TFBackendParser) TerraformBackend

GetBackendConfig parses a backend.tf file TODO, replace this with a cleaner hcl2json2struct merge where backend.tf configurations take priority over defined defaults here

func ParseTFBackend

func ParseTFBackend(fs afero.Fs, log *logrus.Entry, file string) (backend TerraformBackend)

ParseTFBackend parses a backend.tf file

type TerraformPlugin

type TerraformPlugin struct{}

func (TerraformPlugin) Initialize

func (info TerraformPlugin) Initialize(logger *logrus.Entry)

type TerraformStepper

type TerraformStepper struct{}

func (TerraformStepper) ExecuteStep

func (stepper TerraformStepper) ExecuteStep(exec config.StepExecution) config.StepOutput

ExecuteStep deploys a step

func (TerraformStepper) ExecuteStepDestroy

func (stepper TerraformStepper) ExecuteStepDestroy(exec config.StepExecution) config.StepOutput

ExecuteStepDestroy destroys a step

func (TerraformStepper) ExecuteStepTests

func (stepper TerraformStepper) ExecuteStepTests(exec config.StepExecution) (output config.StepTestOutput)

ExecuteStepTests executes the tests for a step

func (TerraformStepper) PreExecute

func (stepper TerraformStepper) PreExecute(exec config.StepExecution) (config.StepExecution, error)

Directories

Path Synopsis
pkg
terraform
Package terraform allows to interact with Terraform.
Package terraform allows to interact with Terraform.

Jump to

Keyboard shortcuts

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