Documentation ¶
Index ¶
- type Client
- func (c *Client) CreateInstance(instanceName string, instanceType string, iamProfile string, imageID string, ...) (*ec2.Reservation, error)
- func (c *Client) CreateInstanceAndWaitUntilReady(instanceName string, instanceType string, iamProfile string, imageID string, ...) error
- func (c *Client) CreateSpotInstance(instanceName string, instanceType string, iamProfile string, imageID string, ...) (*ec2.RequestSpotInstancesOutput, error)
- func (c *Client) CreateSpotInstanceAndWaitUntilReady(instanceName string, instanceType string, iamProfile string, imageID string, ...) error
- func (c *Client) TerminateAllEC2Instances() (*ec2.TerminateInstancesOutput, error)
- func (c *Client) TerminateAllEC2InstancesAndWait() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Client *ec2.EC2 Session *session.Session Ec2InstanceIps []string Ec2InstancePrivateIps []string // contains filtered or unexported fields }
Client ...
func NewEC2Client ¶
NewEC2Client ... ctor region is the region of the bucket you want to access leave it blank to use AWS_REGION environment variable
func NewEC2ClientWithSession ¶
NewEC2ClientWithSession ... ctor
func (*Client) CreateInstance ¶
func (c *Client) CreateInstance(instanceName string, instanceType string, iamProfile string, imageID string, subnetId string, securityGroupIDs []string, userData string, keyName string, minCount int64, maxCount int64) (*ec2.Reservation, error)
CreateInstance creates an EC2 instance
func (*Client) CreateInstanceAndWaitUntilReady ¶ added in v1.1.6
func (c *Client) CreateInstanceAndWaitUntilReady(instanceName string, instanceType string, iamProfile string, imageID string, subnetId string, securityGroupIDs []string, spotPrice string, userData string, keyName string, minCount int64, maxCount int64) error
CreateInstanceAndWaitUntilReady creates a ec2 spot instance and waits until it is ready
func (*Client) CreateSpotInstance ¶
func (c *Client) CreateSpotInstance(instanceName string, instanceType string, iamProfile string, imageID string, subnetId string, securityGroupIDs []string, spotPrice string, userData string, keyName string, instanceCount int64) (*ec2.RequestSpotInstancesOutput, error)
CreateSpotInstance creates a ec2 spot instance
func (*Client) CreateSpotInstanceAndWaitUntilReady ¶ added in v1.1.2
func (c *Client) CreateSpotInstanceAndWaitUntilReady(instanceName string, instanceType string, iamProfile string, imageID string, subnetId string, securityGroupIDs []string, spotPrice string, userData string, keyName string, instanceCount int64) error
CreateSpotInstanceAndWaitUntilReady creates a ec2 spot instance and waits until it is ready
func (*Client) TerminateAllEC2Instances ¶ added in v1.1.2
func (c *Client) TerminateAllEC2Instances() (*ec2.TerminateInstancesOutput, error)
TerminateAllEC2Instances terminate all running EC2 instances created by this client
func (*Client) TerminateAllEC2InstancesAndWait ¶ added in v1.1.2
TerminateAllEC2InstancesAndWait terminate all running EC2 instances created by this client and wait until shutdown