Help us shape the future of Go! Take the 2026 Go Developer Survey

ec2

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeInstancesInput

func DescribeInstancesInput(filter ...*ec2.Filter) *ec2.DescribeInstancesInput

DescribeInstancesInput builds an input with one or multiple filters

Useful in conjunction with Filter

func Filter

func Filter(name, value string) *ec2.Filter

Filter builds a simple key value filter for EC2

Types

type EC2Client added in v0.1.1

type EC2Client struct {
	EC2Client *ec2.EC2
}

EC2Client implementation to offer various load functions for getting data from the API

func NewEC2Client added in v0.1.1

func NewEC2Client(session *session.Session) *EC2Client

NewClient sets up a Client with a AWS session.Session

func (*EC2Client) LoadAllInstancesByFilter added in v0.1.1

func (c *EC2Client) LoadAllInstancesByFilter(filter *ec2.DescribeInstancesInput) (instances *Instances, err error)

LoadAllInstancesByFilter returns Instances with a list of Instance to work with

Also see our Filter and DescribeInstancesInput

func (*EC2Client) LoadInstance added in v0.1.1

func (c *EC2Client) LoadInstance(id string) (instance *Instance, err error)

LoadInstance returns a single Instance looking for its id

func (*EC2Client) LoadInstanceByFilter added in v0.1.1

func (c *EC2Client) LoadInstanceByFilter(filter *ec2.DescribeInstancesInput) (instance *Instance, err error)

LoadInstanceByFilter returns a single Instance using a ec2.DescribeInstancesInput with a ec2.Filter in it

The function expects the result to have exactly one match.

Also see our Filter and DescribeInstancesInput

func (*EC2Client) LoadInstanceByName added in v0.1.1

func (c *EC2Client) LoadInstanceByName(name string) (instance *Instance, err error)

LoadInstanceByName returns a single Instance looking for a name

Name is not required to be unique, but our interface expects it is.

func (*EC2Client) LoadInstanceStatus added in v0.1.1

func (c *EC2Client) LoadInstanceStatus(id string) (status *ec2.InstanceStatus, err error)

LoadInstanceStatus returns the ec2.Instance for an id

type Instance

type Instance struct {
	Instance *ec2.Instance
	Status   *ec2.InstanceStatus
}

func (*Instance) GetLongOutput

func (i *Instance) GetLongOutput() (out string)

func (*Instance) GetOutput

func (i *Instance) GetOutput() (out string)

func (*Instance) GetStatus

func (i *Instance) GetStatus() int

* instance-state-name - The state of the instance (pending | running | shutting-down | terminated | stopping | stopped).

* instance-status.status - The status of the instance (ok | impaired | initializing | insufficient-data | not-applicable).

* system-status.status - The system status of the instance (ok | impaired | initializing | insufficient-data | not-applicable).

type Instances

type Instances struct {
	Instances []*Instance
}

func (Instances) GetOutput

func (i Instances) GetOutput() (output string)

func (Instances) GetStatus

func (i Instances) GetStatus() int

Jump to

Keyboard shortcuts

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