instances

package
v0.0.0-...-90deddd Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	StorageTypeNone = iota
	StorageTypeHDD
	StorageTypeSSD
	StorageTypeSSDNVMe
)

Variables

View Source
var Types = []Type{}/* 489 elements not displayed */

Types stores known EC2 instance types.

View Source
var VerifiedByRegion = make(map[string]map[string]VerifiedStatus)

VerifiedByRegion stores mapping of instance types to VerifiedStatus by AWS Region.

Functions

This section is empty.

Types

type StorageType

type StorageType int

StorageType specifies the type of instance storage.

type Type

type Type struct {
	// Name is the API name of this EC2 instance type.
	Name string
	// EBSOptimized is set to true if the instance type permits EBS optimization.
	EBSOptimized bool
	// EBSThroughput is the max throughput for the EBS optimized instance.
	EBSThroughput float64
	// VCPU stores the number of VCPUs provided by this instance type.
	VCPU uint
	// Memory stores the number of (fractional) GiB of memory provided by this instance type.
	Memory float64
	// StorageDevices stores the number of instance storage devices available for this instance type.
	StorageDevices int
	// StorageSize stores the size of each instance storage device (GiB), so total storage is (StorageDevices*StorageSize).
	StorageSize int
	// StorageType stores the type of instance storage devices available for this instance type.
	StorageType StorageType
	// Price stores the on-demand price per region for this instance type.
	Price map[string]float64
	// Generation stores the generation name for this instance ("current" or "previous").
	Generation string
	// Virt stores the virtualization type used by this instance type.
	Virt string
	// NVMe specifies whether EBS block devices are exposed as NVMe volumes.
	NVMe bool
	// CPUFeatures defines the available CPU features on this instance type
	CPUFeatures map[string]bool
}

Type describes an EC2 instance type.

type VerifiedSrcGenerator

type VerifiedSrcGenerator struct {
	// Package is the target Go package for to generate the Go source code for.
	Package string
	// VerifiedByRegion maps AWS region to a mapping of instance types to VerifiedStatus.
	VerifiedByRegion map[string]map[string]VerifiedStatus
}

VerifiedSrcGenerator generates Go source code of the form found in verified.go (in this package) given a target Go package and a mapping of instance types to VerifiedStatus by AWS Region.

func (*VerifiedSrcGenerator) AddTypes

func (v *VerifiedSrcGenerator) AddTypes(types []string) *VerifiedSrcGenerator

AddTypes adds the given instance types and returns the same generator (for convenience)

func (*VerifiedSrcGenerator) Source

func (v *VerifiedSrcGenerator) Source() ([]byte, error)

Source returns the Go source code representing the contents of this generator.

type VerifiedStatus

type VerifiedStatus struct {
	// Attempted denotes whether a verification attempt has been made.
	Attempted bool
	// Verified denotes whether the instance type is verified to work for Reflow.
	Verified bool
	// ApproxETASeconds is the approximate ETA (in seconds) for Reflow to become available on this instance type.
	ApproxETASeconds int64
	// MemoryBytes is memory bytes reported as available on this Instance type.
	MemoryBytes int64
}

VerifiedStatus captures the verification status for each Instance type.

func (VerifiedStatus) ExpectedMemoryBytes

func (v VerifiedStatus) ExpectedMemoryBytes() int64

ExpectedMemoryBytes is the amount of memory we can expect to be available based on verification.

Jump to

Keyboard shortcuts

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