instances

package
v0.0.0-...-6ef1471 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package instances contains the common code which will find running EC2 instances, and return details about them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstanceOutput

type InstanceOutput struct {

	// AWSAccount is the account number we're running under
	AWSAccount string

	// AvailabilityZone is the zone in which this instance is running
	AvailabilityZone string

	// InstanceID holds the AWS instance ID
	InstanceID string

	// InstanceName holds the AWS instance name, if set
	InstanceName string

	// InstanceAMI holds the AMI name
	InstanceAMI string

	// AMIAge contains the age of the AMI in days.
	AMIAge int

	// InstanceState holds the instance state (stopped, running, etc)
	InstanceState string

	// InstanceType holds the instance type "t2.tiny", etc.
	InstanceType string

	// Keypair setup for access.
	SSHKeyName string

	// SubnetID is the ID of the subnet the instance is running within.
	SubnetID string

	// PublicIPv4 has the public IPv4 address
	PublicIPv4 string

	// PrivateIPv4 has the private IPv4 address
	PrivateIPv4 string

	// Volumes holds all known volumes
	Volumes []Volume

	// VPCID is the ID of the VPC the instance is running within.
	VPCID string
}

InstanceOutput is the structure used to populate our templated output

This structure is used to populate the text/template we use for output generation.

func GetInstances

func GetInstances(svc *ec2.EC2, acct string) ([]InstanceOutput, error)

GetInstances returns details about our running instances.

type Volume

type Volume struct {
	// Device is the name of the device
	Device string

	// ID is the name of the ID
	ID string

	// Size is the size of the device.
	Size string

	// Type is the storage type.
	Type string

	// Encrypted contains the encryption value of the volume
	Encrypted string

	// IOPS holds the speed of the device.
	IOPS string
}

Volume holds detailed regarding an instances volumes.

This structure is used to populate the text/template we use for output generation.

Jump to

Keyboard shortcuts

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