awsup

package
v0.0.0-...-d54b621 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BurstableCreditsToECUS float32 = 3.0 / 60.0

I believe one vCPU ~ 3 ECUS, and 60 CPU credits would be needed to use one vCPU for an hour

Variables

View Source
var MachineTypes []AWSMachineTypeInfo = []AWSMachineTypeInfo{

	{
		Name:           "t2.nano",
		MemoryGB:       0.5,
		ECU:            3 * BurstableCreditsToECUS,
		Cores:          1,
		EphemeralDisks: nil,
		Burstable:      true,
	},
	{
		Name:           "t2.micro",
		MemoryGB:       1,
		ECU:            6 * BurstableCreditsToECUS,
		Cores:          1,
		EphemeralDisks: nil,
		Burstable:      true,
	},
	{
		Name:           "t2.small",
		MemoryGB:       2,
		ECU:            12 * BurstableCreditsToECUS,
		Cores:          1,
		EphemeralDisks: nil,
		Burstable:      true,
	},
	{
		Name:           "t2.medium",
		MemoryGB:       4,
		ECU:            24 * BurstableCreditsToECUS,
		Cores:          2,
		EphemeralDisks: nil,
		Burstable:      true,
	},
	{
		Name:           "t2.large",
		MemoryGB:       8,
		ECU:            36 * BurstableCreditsToECUS,
		Cores:          2,
		EphemeralDisks: nil,
		Burstable:      true,
	},

	{
		Name:           "m3.medium",
		MemoryGB:       3.75,
		ECU:            3,
		Cores:          1,
		EphemeralDisks: []int{4},
	},
	{
		Name:           "m3.large",
		MemoryGB:       7.5,
		ECU:            6.5,
		Cores:          2,
		EphemeralDisks: []int{32},
	},
	{
		Name:           "m3.xlarge",
		MemoryGB:       15,
		ECU:            13,
		Cores:          4,
		EphemeralDisks: []int{40, 40},
	},
	{
		Name:           "m3.2xlarge",
		MemoryGB:       30,
		ECU:            26,
		Cores:          8,
		EphemeralDisks: []int{80, 80},
	},
}

Functions

func NewEC2Filter

func NewEC2Filter(name string, values ...string) *ec2.Filter

Types

type AWSAPITarget

type AWSAPITarget struct {
	Cloud *AWSCloud
}

func NewAWSAPITarget

func NewAWSAPITarget(cloud *AWSCloud) *AWSAPITarget

func (*AWSAPITarget) AddAWSTags

func (t *AWSAPITarget) AddAWSTags(id string, expected map[string]string) error

func (*AWSAPITarget) Finish

func (t *AWSAPITarget) Finish(taskMap map[string]fi.Task) error

func (*AWSAPITarget) WaitForInstanceRunning

func (t *AWSAPITarget) WaitForInstanceRunning(instanceID string) error

type AWSCloud

type AWSCloud struct {
	EC2         *ec2.EC2
	IAM         *iam.IAM
	ELB         *elb.ELB
	Autoscaling *autoscaling.AutoScaling

	Region string
	// contains filtered or unexported fields
}

func NewAWSCloud

func NewAWSCloud(region string, tags map[string]string) (*AWSCloud, error)

func (*AWSCloud) BuildFilters

func (c *AWSCloud) BuildFilters(name *string) []*ec2.Filter

func (*AWSCloud) BuildTags

func (c *AWSCloud) BuildTags(name *string) map[string]string

func (*AWSCloud) CreateTags

func (c *AWSCloud) CreateTags(resourceId string, tags map[string]string) error

func (*AWSCloud) DescribeInstance

func (t *AWSCloud) DescribeInstance(instanceID string) (*ec2.Instance, error)

DescribeInstance is a helper that queries for the specified instance by id

func (*AWSCloud) DescribeVPC

func (t *AWSCloud) DescribeVPC(vpcID string) (*ec2.Vpc, error)

DescribeVPC is a helper that queries for the specified vpc by id

func (*AWSCloud) GetTags

func (c *AWSCloud) GetTags(resourceId string) (map[string]string, error)

func (*AWSCloud) ProviderID

func (c *AWSCloud) ProviderID() fi.CloudProviderID

func (*AWSCloud) ResolveImage

func (c *AWSCloud) ResolveImage(name string) (*ec2.Image, error)

ResolveImage finds an AMI image based on the given name. The name can be one of: `ami-...` in which case it is presumed to be an id owner/name in which case we find the image with the specified name, owned by owner name in which case we find the image with the specified name, with the current owner

func (*AWSCloud) Tags

func (c *AWSCloud) Tags() map[string]string

type AWSMachineTypeInfo

type AWSMachineTypeInfo struct {
	Name           string
	MemoryGB       float32
	ECU            float32
	Cores          int
	EphemeralDisks []int
	Burstable      bool
}

func GetMachineTypeInfo

func GetMachineTypeInfo(machineType string) (*AWSMachineTypeInfo, error)

func (*AWSMachineTypeInfo) EphemeralDevices

func (m *AWSMachineTypeInfo) EphemeralDevices() ([]*EphemeralDevice, error)

type EphemeralDevice

type EphemeralDevice struct {
	DeviceName  string
	VirtualName string
	SizeGB      int
}

Jump to

Keyboard shortcuts

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