core

package
v0.0.0-...-3091b23 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WorkspaceFinalizerName is the name of the finalizer assigned to Workspace objects
	WorkspaceFinalizerName = "workspace.finalizer.scipian.io"

	// ScipianIAMSecretName is the Secret name for the Scipian IAM credentials
	ScipianIAMSecretName = "scipian-aws-iam-creds"

	// ScipianNamespace is the Namespace the ScipianIAMSecretName exists
	ScipianNamespace = "scipian"

	// AccessKey is the AWS_ACCESS_KEY_ID name for the Scipian AWS IAM creds stored in the ScipianIAMSecretName
	AccessKey = "aws_access_key_id"

	// SecretKey is the AWS_SECRET_ACCESS_KEY name for the Scipian AWS IAM creds stored in the ScipianIAMSecretName
	SecretKey = "aws_secret_access_key"

	// TFWorkspaceNew is the Terraform command for creating a new Terraform Workspace
	TFWorkspaceNew = "cp /opt/meta/* %s && terraform init -force-copy && terraform workspace new %s"

	// TFWorkspaceDelete is the Terraform command for deleting an existing Terraform Workspace
	TFWorkspaceDelete = "cp /opt/meta/* %s && terraform init -force-copy && terraform workspace delete -force %s"

	// TFPlan is the Terraform command for initializing, selecting a workspace, planning, and applying
	TFPlan = "" /* 166-byte string literal not displayed */

	// TFDestroy is the Terraform command for running Terraform destroy on resources
	TFDestroy = "cp /opt/meta/* %s && terraform init -force-copy && terraform workspace select %s && terraform destroy -auto-approve"

	//TFStateFileName is the name of the terraform state file
	TFStateFileName = "terraform.tfstate"
)

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(finalizerString string, obj Object)

AddFinalizer adds the finalizer to the given Object

func CustomClientWithCertPool

func CustomClientWithCertPool() (*http.Client, error)

CustomClientWithCertPool is a public function that creates a cert pool to be used with the http client

func HasFinalizer

func HasFinalizer(finalizerString string, obj Object) bool

HasFinalizer checks for the presence of the finalizer

func RemoveFinalizer

func RemoveFinalizer(finalizerString string, obj Object)

RemoveFinalizer removes the finalizer from the given Object

func RetrieveState

func RetrieveState(workspace *terraformv1.Workspace, accessKey string, secretKey string) (string, error)

RetrieveState function downloads tfstate file from S3 bucket and returns the processed tfstate as a string

func S3Puller

func S3Puller(s3Bucket string, filePath string, downloader *s3manager.Downloader, directoryPath string) error

S3Puller is a public function that pulls a terraform.tfstate file from an S3 bucket

Types

type Object

type Object interface {
	runtime.Object
	metav1.Object
}

Object is used as a helper interface when passing Kubernetes resources between methods. All Kubernetes resources should implement both of these interfaces

Jump to

Keyboard shortcuts

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