Added Connection to config
This commit is contained in:
parent
fc84b3a788
commit
38a8232e9a
|
@ -14,6 +14,7 @@ import (
|
||||||
|
|
||||||
awsGo "github.com/awslabs/aws-sdk-go/aws"
|
awsGo "github.com/awslabs/aws-sdk-go/aws"
|
||||||
"github.com/awslabs/aws-sdk-go/gen/autoscaling"
|
"github.com/awslabs/aws-sdk-go/gen/autoscaling"
|
||||||
|
awsEc2 "github.com/awslabs/aws-sdk-go/gen/ec2"
|
||||||
"github.com/awslabs/aws-sdk-go/gen/route53"
|
"github.com/awslabs/aws-sdk-go/gen/route53"
|
||||||
"github.com/awslabs/aws-sdk-go/gen/s3"
|
"github.com/awslabs/aws-sdk-go/gen/s3"
|
||||||
)
|
)
|
||||||
|
@ -32,6 +33,7 @@ type AWSClient struct {
|
||||||
rdsconn *rds.Rds
|
rdsconn *rds.Rds
|
||||||
r53conn *route53.Route53
|
r53conn *route53.Route53
|
||||||
region string
|
region string
|
||||||
|
awsEc2conn *awsEc2.EC2
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client configures and returns a fully initailized AWSClient
|
// Client configures and returns a fully initailized AWSClient
|
||||||
|
@ -76,6 +78,10 @@ func (c *Config) Client() (interface{}, error) {
|
||||||
// See http://docs.aws.amazon.com/general/latest/gr/sigv4_changes.html
|
// See http://docs.aws.amazon.com/general/latest/gr/sigv4_changes.html
|
||||||
log.Println("[INFO] Initializing Route53 connection")
|
log.Println("[INFO] Initializing Route53 connection")
|
||||||
client.r53conn = route53.New(creds, "us-east-1", nil)
|
client.r53conn = route53.New(creds, "us-east-1", nil)
|
||||||
|
|
||||||
|
//Check about using us-east-1 for all
|
||||||
|
log.Println("[INFO] Initializing AWS-GO EC2 Connection")
|
||||||
|
client.awsEc2conn = awsEc2.New(creds, "us-east-1", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(errs) > 0 {
|
if len(errs) > 0 {
|
||||||
|
|
Loading…
Reference in New Issue