context

package
v0.10.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2017 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TerraformVariables = []VariableSchema{
	{
		Name:        "access_key",
		Description: "The aws_access_key_id for your Layer0",
		DisplayName: "AWS Access Key ID",
	},
	{
		Name:        "secret_key",
		Description: "The aws_secret_access_key for your Layer0",
		DisplayName: "AWS Secret Access Key",
	},
	{
		Name:        "region",
		Default:     "us-west-2",
		DisplayName: "AWS Region",
		Description: "The aws_region for your Layer0",
		Validate:    validateRegion,
	},
	{
		Name:         "l0_prefix",
		IsCalculated: true,
		Calculate:    func(c *Context) (string, error) { return c.Instance, nil },
	},
	{
		Name:         "account_id",
		IsCalculated: true,
		Calculate:    getAccountID,
	},
	{
		Name:        "key_pair",
		Description: "The name of an EC2 key pair",
		DisplayName: "Key Pair Name",
	},
	{
		Name:         "s3_bucket",
		IsCalculated: true,
		Calculate:    getS3Bucket,
	},
	{
		Name:         "api_auth_token",
		IsCalculated: true,
		Calculate:    getAuthToken,
	},
	{
		Name:        "api_docker_image",
		Description: "Layer0 API image name (like quintilesims/l0-api)",
		Default:     "quintilesims/l0-api",
	},
	{
		Name:         "api_docker_image_tag",
		Description:  "Layer0 API image tag (like v0.6.0)",
		IsCalculated: true,
		Calculate:    getImageTag,
	},
	{
		Name:         "runner_docker_image_tag",
		Description:  "Layer0 Runner image tag (like v0.6.0)",
		IsCalculated: true,
		Calculate:    getImageTag,
	},
}

Functions

func Apply

func Apply(c *Context, force bool, dockercfgFlag string) error

func Backup

func Backup(c *Context) error

func CopyDir

func CopyDir(source, dest string) error

func CopyFile

func CopyFile(src, dest string) error

func Destroy

func Destroy(c *Context, force bool) error

func Endpoint

func Endpoint(c *Context, syntax string, insecure, dev, quiet bool) error

func FileExists

func FileExists(path string) bool

func GetExecutionDir

func GetExecutionDir() (string, error)

func Plan

func Plan(c *Context, dockercfgFlag string, force bool, args []string) error

func ReadFileLines

func ReadFileLines(path string) ([]string, error)

func ReadTFVars

func ReadTFVars(varsFile string) (map[string]string, error)

func Restore

func Restore(c *Context) error

func Terraform

func Terraform(c *Context, args []string) error

func Vpc

func Vpc(c *Context, vpcId string) error

Types

type Auth

type Auth struct {
	Auth  string `json:"auth,omitempty"`
	Email string `json:"email,ommitempty"`
}

type ByIPDesc

type ByIPDesc []*net.IPNet

sort functions for net.IPNet (cidr blocks)

func (ByIPDesc) Len

func (ip ByIPDesc) Len() int

func (ByIPDesc) Less

func (ip ByIPDesc) Less(i, j int) bool

func (ByIPDesc) Swap

func (ip ByIPDesc) Swap(i, j int)

type ByString

type ByString []string

func (ByString) Len

func (ip ByString) Len() int

func (ByString) Less

func (ip ByString) Less(i, j int) bool

func (ByString) Swap

func (ip ByString) Swap(i, j int)

type Context

type Context struct {
	Instance         string
	StateFile        string
	VarsFile         string
	DockerConfigFile string
	InstanceDir      string
	ExecutionDir     string
	Flags            map[string]*string
	TerraformVars    map[string]string
	// contains filtered or unexported fields
}

func NewContext

func NewContext(instance, version string, flags map[string]*string) (*Context, error)

func (*Context) Load

func (this *Context) Load(mustExist bool) error

func (*Context) PromptTFVar

func (this *Context) PromptTFVar(key, display string) (string, error)

func (*Context) Save

func (this *Context) Save() error

func (*Context) Terraformf

func (this *Context) Terraformf(showOutput bool, args ...string) (string, error)

type DockerConfigFile

type DockerConfigFile struct {
	Auths map[string]Auth `json:"auths,omitempty"`
}

func (*DockerConfigFile) Write

func (d *DockerConfigFile) Write(path string) error

type TFModule

type TFModule struct {
	Path      []string               `json:"path"`
	Outputs   map[string]interface{} `json:"outputs"`
	Resources map[string]interface{} `json:"resources"`
}

type TFState

type TFState struct {
	Version int        `json:"version"`
	Serial  int        `json:"serial"`
	Modules []TFModule `json:"modules"`
}

type VariableSchema

type VariableSchema struct {
	Name            string
	DisplayName     string
	Default         string
	Description     string
	IsCalculated    bool
	AlwaysCalculate bool
	Calculate       func(*Context) (string, error)
	Validate        func(*Context, string) error
}

func GetTerraformVariable

func GetTerraformVariable(name string) (VariableSchema, bool)

Jump to

Keyboard shortcuts

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