ec2

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the EC2 API for instance operations.

func NewClient

func NewClient(cfg aws.Config) *Client

NewClient creates a new EC2 client from the provided AWS config.

func (*Client) ListInstances

func (c *Client) ListInstances(ctx context.Context, nextToken *string) ([]Instance, *string, error)

ListInstances returns EC2 instances, paginated via token.

type EC2API

type EC2API interface {
	DescribeInstances(ctx context.Context, params *ec2.DescribeInstancesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstancesOutput, error)
}

EC2API captures the AWS SDK methods we use.

type Instance

type Instance struct {
	InstanceID       string
	Name             string // from Name tag
	State            string // running, stopped, terminated, etc.
	InstanceType     string
	PrivateIP        string
	PublicIP         string
	LaunchTime       time.Time
	VpcID            string
	SubnetID         string
	AvailabilityZone string
	Architecture     string
	Platform         string
	ImageID          string
	KeyName          string
	SecurityGroups   []SecurityGroup
	IAMProfile       string
	Tags             map[string]string
}

Instance represents an EC2 instance.

type SecurityGroup

type SecurityGroup struct {
	ID   string
	Name string
}

SecurityGroup is a minimal reference to an EC2 security group.

Jump to

Keyboard shortcuts

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