ec2

package
v0.0.0-...-08b716b Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInstanceNotFound = errors.New("instance not found")

ErrInstanceNotFound indicates an instance could not be found for the given identifier.

Functions

This section is empty.

Types

type Client

type Client interface {
	// GetEC2Instance retrieves an Instance associated with ip. If no Instance can be
	// found, it should return ErrInstanceNotFound.
	GetEC2Instance(_ context.Context, ip string) (Instance, error)
}

Client is a backend for retrieving EC2 Instance data.

type Frontend

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

Frontend is an EC2 HTTP API frontend. It is responsible for configuring routers with handlers for the AWS EC2 instance metadata API.

func New

func New(client Client) Frontend

New creates a new Frontend.

func (Frontend) Configure

func (f Frontend) Configure(router gin.IRouter)

Configure configures router with the supported AWS EC2 instance metadata API endpoints.

TODO(chrisdoherty4) Document unimplemented endpoints.

type Instance

type Instance struct {
	Userdata string
	Metadata Metadata
}

Instance is a struct that contains the hardware data exposed from the EC2 API endpoints. For an explanation of the endpoints refer to the AWS EC2 Instance Metadata documentation.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html

Note not all AWS EC2 Instance Metadata categories are supported as some are not applicable. Deviations from the AWS EC2 Instance Metadata should be documented here.

type LicenseActivation

type LicenseActivation struct {
	State string
}

LicenseActivation is part of OperatingSystem.

type Metadata

type Metadata struct {
	InstanceID      string
	Hostname        string
	LocalHostname   string
	IQN             string
	Plan            string
	Facility        string
	Tags            []string
	PublicKeys      []string
	PublicIPv4      string
	PublicIPv6      string
	LocalIPv4       string
	OperatingSystem OperatingSystem
}

Metadata is a part of Instance.

type OperatingSystem

type OperatingSystem struct {
	Slug              string
	Distro            string
	Version           string
	ImageTag          string
	LicenseActivation LicenseActivation
}

OperatingSystem is part of Metadata.

Directories

Path Synopsis
internal
staticroute
Package staticroute provides tools for building EC2 Instance Metadata static routes from the set of data endpoints.
Package staticroute provides tools for building EC2 Instance Metadata static routes from the set of data endpoints.

Jump to

Keyboard shortcuts

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