Exemple #1
0
func NewAWSCluster(conf AWSOptions) (Cluster, error) {
	api := ec2.New(aws.NewConfig().WithCredentials(credentials.NewEnvCredentials()))

	agent, err := network.NewSSHAgent(&net.Dialer{})
	if err != nil {
		return nil, err
	}

	ac := &awsCluster{
		api:   api,
		conf:  conf,
		agent: agent,
		machs: make(map[string]*awsMachine),
	}

	return ac, nil
}
Exemple #2
0
// NewAWSCluster creates an instance of a Cluster suitable for spawning
// instances on Amazon Web Services' Elastic Compute platform.
//
// NewAWSCluster will consume the environment variables $AWS_REGION,
// $AWS_ACCESS_KEY_ID, and $AWS_SECRET_ACCESS_KEY to determine the region to
// spawn instances in and the credentials to use to authenticate.
func NewAWSCluster(conf AWSOptions) (Cluster, error) {
	cfg := aws.NewConfig().WithCredentials(credentials.NewEnvCredentials())
	api := ec2.New(session.New(cfg))

	bc, err := newBaseCluster()
	if err != nil {
		return nil, err
	}

	ac := &awsCluster{
		baseCluster: bc,
		api:         api,
		conf:        conf,
	}

	return ac, nil
}