Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) AvailableInstanceTypes(ctx context.Context) ([]*EC2TypeInfo, error)
- func (c *Client) CreateInstance(ctx context.Context, cfg InstanceConfig) (*ec2.Instance, error)
- func (c *Client) DeleteInstance(ctx context.Context, region, instanceID string) (*ec2.InstanceStateChange, error)
- func (c *Client) GetInstance(ctx context.Context, region, id string) (*ec2.Instance, error)
- func (c *Client) ListRegionInstances(ctx context.Context, region string, tags map[string]string) ([]*ec2.Instance, error)
- type EC2TypeAttributes
- type EC2TypeInfo
- type InstanceConfig
Constants ¶
View Source
const ( TagName = "Name" TagCluster = "KubernetesCluster" TagRole = "Role" )
Tag keys for aws resources:
Variables ¶
View Source
var ( ErrInvalidKeys = errors.New("aws: invalid keys") ErrNoRegionProvided = errors.New("aws: region should shouldn't be emplty") ErrInstanceIDEmpty = errors.New("aws: instance id shouldn't be emplty") ErrNoInstancesCreated = errors.New("aws: no instances were created") ErrInstanceNotFound = errors.New("aws: instance: not found") )
AWS client specific errors:
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client used for accessing AWS resources.
func (*Client) AvailableInstanceTypes ¶
func (c *Client) AvailableInstanceTypes(ctx context.Context) ([]*EC2TypeInfo, error)
AvailableInstanceTypes returns a list of valid instance types for the region.
func (*Client) CreateInstance ¶
CreateInstance starts a new instance due to the config.
func (*Client) DeleteInstance ¶
func (c *Client) DeleteInstance(ctx context.Context, region, instanceID string) (*ec2.InstanceStateChange, error)
DeleteInstance terminates an instance with provided id and region.
func (*Client) GetInstance ¶
GetInstance retrieves an instance by instanceID.
type EC2TypeAttributes ¶
type EC2TypeAttributes struct { ServiceCode string `json:"servicecode"` ServiceName string `json:"servicename"` InstanceFamily string `json:"instanceFamily"` InstanceType string `json:"instanceType"` OperatingSystem string `json:"operatingSystem"` Location string `json:"location"` VCPU string `json:"vcpu"` Memory string `json:"memory"` ECU string `json:"ecu"` PhysicalProcessor string `json:"physicalProcessor"` Storage string `json:"storage"` CapacityStatus string `json:"capacitystatus"` }
type EC2TypeInfo ¶
type EC2TypeInfo struct { SKU string `json:"sku"` ProductFamily string `json:"productFamily"` Attributes *EC2TypeAttributes `json:"attributes"` }
type InstanceConfig ¶
type InstanceConfig struct { TagName string Type string TagClusterName string TagClusterRole string ID string Region string ImageID string KeyName string HasPublicAddr bool SecurityGroups []*string SubnetID string IAMRole string VolumeType string VolumeSize int64 VolumeDeviceName string EBSOptimized *bool Tags map[string]string UsedData string }
Click to show internal directories.
Click to hide internal directories.