cmd

package
v0.0.0-...-2386280 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TfCmdApply   = "apply"
	TfCmdDestroy = "destroy"
	TfCmdInit    = "init"
	TfCmdOutput  = "output"
	TfCmdPlan    = "plan"
	TfCmdRefresh = "refresh"
)

Terraform CLI Commands

View Source
const (
	TfOutputInstanceType   = "instance_type"
	TfOutputRegion         = "region"
	TfOutputServerKey      = "server_key"
	TfOutputSpotInstanceID = "spot_instance_id"
	TfOutputSpotPrice      = "spot_price"
	TfOutputSubnetID       = "subnet_id"
	TfOutputVpcID          = "vpc_id"
)

Parsec Terraform Template Outputs

View Source
const (
	TfFlagForce       = "-force"
	TfFlagJSON        = "-json"
	TfFlagAutoApprove = "-auto-approve"
)

Terraform CLI Command Flags

View Source
const (
	Template       = "parsec.tf"
	Userdata       = "user_data.tmpl"
	CurrentSession = "currentSession.json"
)

Filenames

View Source
const (
	Windows = "Windows"
	OK      = "ok"
)

Product Description and Instance Statuses

View Source
const Terraform = "terraform"

Terraform command

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "parsec-ec2",
	Short: "Start and stop Parsec EC2 instances with a single command",
	Long:  ``,
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type TfOutputs

type TfOutputs struct {
	InstanceType struct {
		Sensitive bool   `json:"sensitive"`
		Type      string `json:"type"`
		Value     string `json:"value"`
	} `json:"instance_type"`
	Region struct {
		Sensitive bool   `json:"sensitive"`
		Type      string `json:"type"`
		Value     string `json:"value"`
	} `json:"region"`
	ServerKey struct {
		Sensitive bool   `json:"sensitive"`
		Type      string `json:"type"`
		Value     string `json:"value"`
	} `json:"server_key"`
	SpotInstanceID struct {
		Sensitive bool   `json:"sensitive"`
		Type      string `json:"type"`
		Value     string `json:"value"`
	} `json:"spot_instance_id"`
	SpotBidStatus struct {
		Sensitive bool   `json:"sensitive"`
		Type      string `json:"type"`
		Value     string `json:"value"`
	} `json:"spot_bid_status"`
	SpotPrice struct {
		Sensitive bool   `json:"sensitive"`
		Type      string `json:"type"`
		Value     string `json:"value"`
	} `json:"spot_price"`
	SubnetID struct {
		Sensitive bool   `json:"sensitive"`
		Type      string `json:"type"`
		Value     string `json:"value"`
	} `json:"subnet_id"`
	VpcID struct {
		Sensitive bool   `json:"sensitive"`
		Type      string `json:"type"`
		Value     string `json:"value"`
	} `json:"vpc_id"`
}

func (*TfOutputs) Read

func (v *TfOutputs) Read() error

type TfVars

type TfVars struct {
	AmiName      string `json:"amiName"`
	IP           string `json:"ip"`
	InstanceType string `json:"instance_type"`
	Region       string `json:"region"`
	ServerKey    string `json:"server_key"`
	SpotPrice    string `json:"spot_price"`
	SubnetID     string `json:"subnet_id"`
	VpcID        string `json:"vpc_id"`
	VolumeSize   int    `json:"volume_size"`
}

func (*TfVars) Calculate

func (v *TfVars) Calculate(ec2Client *ec2.EC2, region, serverKey, instanceType, amiName string, volumeSize int) error

func (*TfVars) Write

func (v *TfVars) Write() error

Jump to

Keyboard shortcuts

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