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
- Variables
- func GetDefaultKeyName(awsCfg aws.Config) string
- func GetDefaultSecurityGroupId(awsCfg aws.Config) (string, error)
- func GetImageDesc(os internal.OperatingSystem) string
- func GetLocalDefaultKeyFile(awsCfg aws.Config) (string, error)
- func GetTagValue(awsCfg aws.Config, instanceId string, key string) (string, error)
- func TerminateInstance(awsCfg aws.Config, instanceId string) error
- func UpdateTag(awsCfg aws.Config, instanceId string, key string, value string) error
- type LaunchEc2SpotArgs
- type LaunchEc2SpotResult
- type LookupEc2SpotPriceAz
- type LookupEc2SpotPriceIType
- type LookupEc2SpotPriceRegion
- type LookupEc2SpotPriceResult
- type LookupImageItem
- type LookupImagesResult
- type LookupKeyItem
- type LookupKeysResult
- type LookupVpcSgsResult
- type LookupVpcSgsSg
- type LookupVpcSgsVpc
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 ¶
View Source
var DefaultInstanceTypes = []types.InstanceType{types.InstanceTypeC5aLarge, types.InstanceTypeC5Large, types.InstanceTypeC6iLarge, types.InstanceTypeC6aLarge, }
Functions ¶
func GetDefaultKeyName ¶ added in v0.4.0
func GetDefaultSecurityGroupId ¶ added in v0.4.0
func GetImageDesc ¶ added in v0.4.0
func GetImageDesc(os internal.OperatingSystem) string
func GetTagValue ¶ added in v0.13.0
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 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 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 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 LookupVpcSgsVpc ¶
type LookupVpcSgsVpc struct { Id string Default bool Sgs map[string]*LookupVpcSgsSg }
Click to show internal directories.
Click to hide internal directories.