cliaas

package module
v0.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2017 License: Apache-2.0 Imports: 8 Imported by: 2

README

cliaas

a cli tool to help with iaas interactions (this is meant to be a single cli for all iaases, instead of pulling in each individual tool for each iaas)

unit test status: concourse.customer0.io

integration test status: concourse.customer0.io

Configuration

The cliaas tool takes configuration in the form of environment variables. The following must be set depending on which IaaS provider you wish to target:

AWS
  • AWS_ACCESS_KEY
  • AWS_SECRET_KEY
  • AWS_REGION
  • AWS_VPC
CLI
aws command options]
          --accesskey=    aws access key [$AWS_ACCESSKEY]
          --secretkey=    aws secret access key [$AWS_SECRETKEY]
          --region=       aws region (default: us-east-1) [$AWS_REGION]
          --vpc=          aws VPC id [$AWS_VPC]
          --name=         aws name tag for vm [$AWS_NAME]
          --ami=          aws ami to provision [$AWS_AMI]
          --instanceType= aws instance type to provision [$AWS_INSTANCE_TYPE]
          --elastic-ip=   aws elastic ip to associate to provisioned VM [$AWS_ELASTIC_IP]
GCP
  • GCP_CREDS - String representation of the creds file
  • GCP_PROJECT
  • GCP_ZONE

CI Pipeline

The integration-tests job can read GCP credentials through a params file or can be passed in via the command line as follows to avoid copying data from the credentials JSON:

fly -t c0 set-pipeline -p cliaas-ci -c ci/pipeline.yml -l ci/params.yml --var
gcp_creds="$(cat /path/to/creds.json)"
Integration Tests

The IAAS environment variable can be used to target a specific providers integration tests when running integration_tests/task.yml.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.0.0-dev"

Functions

This section is empty.

Types

type AWSClient added in v0.1.0

type AWSClient interface {
	CreateVM(ami, instanceType, name, keyName, subnetID, securityGroupID string) (string, error)
	DeleteVM(instanceID string) error
	GetVMInfo(name string) (VMInfo, error)
	StopVM(instanceID string) error
	AssignPublicIP(instance, ip string) error
	WaitForStatus(instanceID string, status string) error
}

func NewAWSClient added in v0.1.0

func NewAWSClient(
	ec2Client EC2Client,
	vpcName string,
	options ...OptionFunc,
) AWSClient

type Config added in v0.1.0

type Config struct {
	AWS struct {
		AccessKeyID     string `yaml:"access_key_id"`
		SecretAccessKey string `yaml:"secret_access_key"`
		Region          string `yaml:"region"`
		VPC             string `yaml:"vpc"`
		AMI             string `yaml:"ami"`
	} `yaml:"aws"`
}

type OptionFunc added in v0.1.0

type OptionFunc func(*client)

func Clock added in v0.1.0

func Clock(clock clock.Clock) OptionFunc

func Timeout added in v0.1.0

func Timeout(timeout time.Duration) OptionFunc

type VMInfo added in v0.1.0

type VMInfo struct {
	InstanceID       string
	InstanceType     string
	KeyName          string
	SubnetID         string
	SecurityGroupIDs []string
	PublicIP         string
}

type VMReplacer added in v0.1.0

type VMReplacer interface {
	Replace(identifier string) error
}

func NewAWSVMReplacer added in v0.1.0

func NewAWSVMReplacer(
	accessKeyID string,
	secretAccessKey string,
	region string,
	vpc string,
	ami string,
) (VMReplacer, error)

func NewVMReplacer added in v0.1.0

func NewVMReplacer(config Config) (VMReplacer, error)

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter
cmd
gcp
gcp/gcpfakes
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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