aws

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright © 2022 Mike Brown. All Rights Reserved. * * See LICENSE file at the root of this package for license terms

Copyright © 2022 Mike Brown. All Rights Reserved. * * See LICENSE file at the root of this package for license terms

Copyright © 2022 Mike Brown. All Rights Reserved. * * See LICENSE file at the root of this package for license terms

Copyright © 2022 Mike Brown. All Rights Reserved. * * See LICENSE file at the root of this package for license terms

Copyright © 2022 Mike Brown. All Rights Reserved. * * See LICENSE file at the root of this package for license terms

Index

Constants

View Source
const (
	UserTagKey              = "spotsh.user"
	OsTagKey                = "spotsh.os"
	VpnTagKey               = "spotsh.vpn"
	DefaultRootVolSizeInGiB = int32(64)
	DefaultMaxSpotPrice     = "0.08"
)
View Source
const DefaultOperatingSystem = internal.AmazonLinux2023

Variables

Functions

func GetDefaultKeyName added in v0.4.0

func GetDefaultKeyName(awsCfg aws.Config) string

func GetDefaultSecurityGroupId added in v0.4.0

func GetDefaultSecurityGroupId(awsCfg aws.Config) (string, error)

func GetImageDesc added in v0.4.0

func GetImageDesc(os internal.OperatingSystem) string

func GetLocalDefaultKeyFile

func GetLocalDefaultKeyFile(awsCfg aws.Config) (string, error)

func GetTagValue added in v0.13.0

func GetTagValue(awsCfg aws.Config, instanceId string,
	key string) (string, error)

func TerminateInstance

func TerminateInstance(awsCfg aws.Config, instanceId string) error

func UpdateTag added in v0.13.0

func UpdateTag(awsCfg aws.Config, instanceId string, key string,
	value string) error

Types

type LaunchEc2SpotArgs

type LaunchEc2SpotArgs struct {
	Os               internal.OperatingSystem // optional; defaults to AmazonLinux2023
	AmiId            string                   // optional; overrides Os; defaults to latest ami for specified Os
	AmiName          string                   // optional; default is ignored in lieu of AmiId
	KeyPair          string                   // optional; defaults to spotinst keypair
	SecurityGroupId  string                   // optional; defaults to default VPC's default SG
	AttachRoleName   string                   // optional; defaults to no attached role
	InitCmd          string                   // optional; defaults to empty
	InstanceTypes    []types.InstanceType     // optional; defaults to c5a.large
	MaxSpotPrice     string                   // optional; defaults to "0.08" (USD$/hour)
	User             string                   // optional; defaults to Os's default user
	RootVolSizeInGiB int32                    // optional; defaults to 64GiB
}

type LaunchEc2SpotResult

type LaunchEc2SpotResult struct {
	PublicIp     string
	InstanceId   string
	User         string
	LocalKeyFile string
	InstanceType types.InstanceType
	ImageId      string
	CurrentPrice float64
	AzName       string
	DnsName      string
	Os           internal.OperatingSystem
}

func LaunchEc2Spot

func LaunchEc2Spot(awsCfg aws.Config,
	launchArgs *LaunchEc2SpotArgs) (LaunchEc2SpotResult, error)

func LookupEc2Spot

func LookupEc2Spot(awsCfg aws.Config) ([]LaunchEc2SpotResult, error)

type LookupEc2SpotPriceAz added in v0.9.0

type LookupEc2SpotPriceAz struct {
	AzName   string
	CurPrice float64
}

type LookupEc2SpotPriceIType added in v0.9.0

type LookupEc2SpotPriceIType struct {
	InstanceType   types.InstanceType
	Regions        map[string]*LookupEc2SpotPriceRegion
	CheapestRegion *LookupEc2SpotPriceRegion
}

type LookupEc2SpotPriceRegion added in v0.9.0

type LookupEc2SpotPriceRegion struct {
	Region     string
	Azs        map[string]*LookupEc2SpotPriceAz
	CheapestAz *LookupEc2SpotPriceAz
}

type LookupEc2SpotPriceResult added in v0.9.0

type LookupEc2SpotPriceResult struct {
	InstanceTypes map[types.InstanceType]*LookupEc2SpotPriceIType
	CheapestIType *LookupEc2SpotPriceIType
	// contains filtered or unexported fields
}

func LookupEc2SpotPrices added in v0.9.0

func LookupEc2SpotPrices(awsCfg aws.Config,
	iTypes []types.InstanceType) (*LookupEc2SpotPriceResult, error)

type LookupImageItem added in v0.7.0

type LookupImageItem struct {
	Id        string
	Name      string
	Ownership string
}

type LookupImagesResult added in v0.7.0

type LookupImagesResult struct {
	Images map[string]*LookupImageItem
}

func LookupImages added in v0.7.0

func LookupImages(awsCfg aws.Config) (LookupImagesResult, error)

type LookupKeyItem

type LookupKeyItem struct {
	Id           string
	Name         string
	PublicKey    string
	Fingerprint  string
	LocalKeyFile string
}

type LookupKeysResult

type LookupKeysResult struct {
	Keys map[string]*LookupKeyItem
}

func LookupKeys

func LookupKeys(awsCfg aws.Config) (LookupKeysResult, error)

type LookupVpcSgsResult

type LookupVpcSgsResult struct {
	Vpcs map[string]*LookupVpcSgsVpc
}

func LookupVpcSecurityGroups

func LookupVpcSecurityGroups(awsCfg aws.Config) (LookupVpcSgsResult, error)

type LookupVpcSgsSg

type LookupVpcSgsSg struct {
	Id   string
	Name string
}

type LookupVpcSgsVpc

type LookupVpcSgsVpc struct {
	Id      string
	Default bool
	Sgs     map[string]*LookupVpcSgsSg
}

Jump to

Keyboard shortcuts

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