diff --git a/Makefile b/Makefile index af89fc04f..fdb9ab3d6 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ updatedeps: | xargs go list -f '{{join .Deps "\n"}}' \ | grep -v github.com/hashicorp/terraform \ | sort -u \ - | xargs go get -u -v + | xargs go get -f -u -v cover: @go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \ diff --git a/builtin/providers/aws/config.go b/builtin/providers/aws/config.go index 18dbe92e2..65abbe23c 100644 --- a/builtin/providers/aws/config.go +++ b/builtin/providers/aws/config.go @@ -65,8 +65,7 @@ func (c *Config) Client() (interface{}, error) { creds := awsGo.Creds(c.AccessKey, c.SecretKey, c.Token) log.Println("[INFO] Initializing EC2 connection") - client.ec2conn = ec2.New(auth, region) - client.ec2conn2 = awsec2.New(creds, c.Region, nil) + client.ec2conn = ec2.New(auth, region) log.Println("[INFO] Initializing ELB connection") client.elbconn = elb.New(creds, c.Region, nil) log.Println("[INFO] Initializing AutoScaling connection") diff --git a/builtin/providers/aws/resource_aws_network_interface.go b/builtin/providers/aws/resource_aws_network_interface.go index 4241f8bde..acf5b6a17 100644 --- a/builtin/providers/aws/resource_aws_network_interface.go +++ b/builtin/providers/aws/resource_aws_network_interface.go @@ -78,7 +78,7 @@ func resourceAwsNetworkInterface() *schema.Resource { func resourceAwsNetworkInterfaceCreate(d *schema.ResourceData, meta interface{}) error { - ec2conn := meta.(*AWSClient).ec2conn2 + ec2conn := meta.(*AWSClient).awsEC2conn request := &ec2.CreateNetworkInterfaceRequest{ Groups: expandStringList(d.Get("security_groups").(*schema.Set).List()), @@ -101,7 +101,7 @@ func resourceAwsNetworkInterfaceCreate(d *schema.ResourceData, meta interface{}) func resourceAwsNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) error { - ec2conn := meta.(*AWSClient).ec2conn2 + ec2conn := meta.(*AWSClient).awsEC2conn describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesRequest{ NetworkInterfaceIDs: []string{d.Id()}, } @@ -162,7 +162,7 @@ func resourceAwsNetworkInterfaceDetach(oa *schema.Set, meta interface{}, eniId s AttachmentID: aws.String(old_attachment["attachment_id"].(string)), Force: aws.Boolean(true), } - ec2conn := meta.(*AWSClient).ec2conn2 + ec2conn := meta.(*AWSClient).awsEC2conn detach_err := ec2conn.DetachNetworkInterface(detach_request) if detach_err != nil { return fmt.Errorf("Error detaching ENI: %s", detach_err) @@ -189,7 +189,7 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) d.Partial(true) if d.HasChange("attachment") { - ec2conn := meta.(*AWSClient).ec2conn2 + ec2conn := meta.(*AWSClient).awsEC2conn oa, na := d.GetChange("attachment") detach_err := resourceAwsNetworkInterfaceDetach(oa.(*schema.Set), meta, d.Id()) @@ -220,7 +220,7 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) Groups: expandStringList(d.Get("security_groups").(*schema.Set).List()), } - ec2conn := meta.(*AWSClient).ec2conn2 + ec2conn := meta.(*AWSClient).awsEC2conn err := ec2conn.ModifyNetworkInterfaceAttribute(request) if err != nil { return fmt.Errorf("Failure updating ENI: %s", err) @@ -235,7 +235,7 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) } func resourceAwsNetworkInterfaceDelete(d *schema.ResourceData, meta interface{}) error { - ec2conn := meta.(*AWSClient).ec2conn2 + ec2conn := meta.(*AWSClient).awsEC2conn log.Printf("[INFO] Deleting ENI: %s", d.Id()) diff --git a/builtin/providers/aws/resource_aws_network_interface_test.go b/builtin/providers/aws/resource_aws_network_interface_test.go index 27eedba45..f48a4c4d8 100644 --- a/builtin/providers/aws/resource_aws_network_interface_test.go +++ b/builtin/providers/aws/resource_aws_network_interface_test.go @@ -71,7 +71,7 @@ func testAccCheckAWSENIExists(n string, res *ec2.NetworkInterface) resource.Test return fmt.Errorf("No ENI ID is set") } - ec2conn := testAccProvider.Meta().(*AWSClient).ec2conn2 + ec2conn := testAccProvider.Meta().(*AWSClient).awsEC2conn describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesRequest{ NetworkInterfaceIDs: []string{rs.Primary.ID}, } @@ -148,7 +148,7 @@ func testAccCheckAWSENIDestroy(s *terraform.State) error { continue } - ec2conn := testAccProvider.Meta().(*AWSClient).ec2conn2 + ec2conn := testAccProvider.Meta().(*AWSClient).awsEC2conn describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesRequest{ NetworkInterfaceIDs: []string{rs.Primary.ID}, }