aws

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available returns the availability status

func DeallocateIP

func DeallocateIP(ipToRelease *net.IP) error

DeallocateIP releases an IP back to AWS

func RemoveInterface

func RemoveInterface(interfaceIDs []string) error

RemoveInterface gracefull shutdown and removal of interfaces Simply detach the interface, wait for it to come down and then removes.

Types

type AllocationResult

type AllocationResult struct {
	*net.IP
	Interface Interface
}

AllocationResult contains a net.IP / Interface pair

func AllocateIPFirstAvailable

func AllocateIPFirstAvailable() (*AllocationResult, error)

AllocateIPFirstAvailable allocates an IP address on the first available IP address Returns a reference to the interface the IP was allocated on

func AllocateIPFirstAvailableAtIndex

func AllocateIPFirstAvailableAtIndex(index int) (*AllocationResult, error)

AllocateIPFirstAvailableAtIndex allocates an IP address, skipping any adapter < the given index Returns a reference to the interface the IP was allocated on

func AllocateIPOn

func AllocateIPOn(intf Interface) (*AllocationResult, error)

AllocateIPOn allocates an IP on a specific interface.

type ENILimit

type ENILimit struct {
	Adapters int
	IPv4     int
	IPv6     int
}

ENILimit contains limits for adapter count and addresses

func ENILimits

func ENILimits() ENILimit

ENILimits returns the limits based on the system's instance type

func ENILimitsForInstanceType

func ENILimitsForInstanceType(itype string) (limit ENILimit)

ENILimitsForInstanceType returns the limits for ENI for an instance type Returns a zero-limit for unknown instance types

type Interface

type Interface struct {
	ID     string
	Mac    string
	Number int
	IPv4s  []net.IP

	SubnetID   string
	SubnetCidr *net.IPNet

	VpcID            string
	VpcPrimaryCidr   *net.IPNet
	VpcCidrs         []*net.IPNet
	SecurityGroupIds []string
}

Interface describes an interface from the metadata service

func GetInterfaces

func GetInterfaces() ([]Interface, error)

GetInterfaces returns a list of configured interfaces

func NewInterface

func NewInterface(secGrps []string, requiredTags map[string]string) (*Interface, error)

NewInterface creates an Interface based on specified parameters

func NewInterfaceOnSubnetAtIndex

func NewInterfaceOnSubnetAtIndex(index int, secGrps []string, subnet Subnet) (*Interface, error)

NewInterfaceOnSubnetAtIndex creates a new Interface with a specified subnet and index

func (Interface) LocalName

func (i Interface) LocalName() string

LocalName returns the instance name in string form

type Interfaces

type Interfaces []Interface

Interfaces contains a slice of Interface

func (Interfaces) Len

func (a Interfaces) Len() int

func (Interfaces) Less

func (a Interfaces) Less(i, j int) bool

func (Interfaces) Swap

func (a Interfaces) Swap(i, j int)

type Subnet

type Subnet struct {
	ID                    string
	Cidr                  string
	IsDefault             bool
	AvailableAddressCount int
	Name                  string
	Tags                  map[string]string
}

Subnet contains attributes of a subnet

func GetSubnetsForInstance

func GetSubnetsForInstance() ([]Subnet, error)

GetSubnetsForInstance returns a list of subnets for the running instance

type SubnetsByAvailableAddressCount

type SubnetsByAvailableAddressCount []Subnet

SubnetsByAvailableAddressCount contains a list of subnet

func (SubnetsByAvailableAddressCount) Len

func (SubnetsByAvailableAddressCount) Less

func (SubnetsByAvailableAddressCount) Swap

func (a SubnetsByAvailableAddressCount) Swap(i, j int)

Jump to

Keyboard shortcuts

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