Strike 'goamz' from the repo'
This commit is contained in:
parent
57556bba75
commit
580b696e7f
|
@ -7,17 +7,14 @@ import (
|
|||
"unicode"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/multierror"
|
||||
"github.com/mitchellh/goamz/aws"
|
||||
"github.com/mitchellh/goamz/ec2"
|
||||
|
||||
awsGo "github.com/hashicorp/aws-sdk-go/aws"
|
||||
"github.com/hashicorp/aws-sdk-go/aws"
|
||||
"github.com/hashicorp/aws-sdk-go/gen/autoscaling"
|
||||
"github.com/hashicorp/aws-sdk-go/gen/ec2"
|
||||
"github.com/hashicorp/aws-sdk-go/gen/elb"
|
||||
"github.com/hashicorp/aws-sdk-go/gen/rds"
|
||||
"github.com/hashicorp/aws-sdk-go/gen/route53"
|
||||
"github.com/hashicorp/aws-sdk-go/gen/s3"
|
||||
|
||||
awsEC2 "github.com/hashicorp/aws-sdk-go/gen/ec2"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
|
@ -29,7 +26,6 @@ type Config struct {
|
|||
|
||||
type AWSClient struct {
|
||||
ec2conn *ec2.EC2
|
||||
awsEC2conn *awsEC2.EC2
|
||||
elbconn *elb.ELB
|
||||
autoscalingconn *autoscaling.AutoScaling
|
||||
s3conn *s3.S3
|
||||
|
@ -62,10 +58,8 @@ func (c *Config) Client() (interface{}, error) {
|
|||
// bucket storage in S3
|
||||
client.region = c.Region
|
||||
|
||||
creds := awsGo.Creds(c.AccessKey, c.SecretKey, c.Token)
|
||||
creds := aws.Creds(c.AccessKey, c.SecretKey, c.Token)
|
||||
|
||||
log.Println("[INFO] Initializing EC2 connection")
|
||||
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")
|
||||
|
@ -80,7 +74,7 @@ func (c *Config) Client() (interface{}, error) {
|
|||
// See http://docs.aws.amazon.com/general/latest/gr/sigv4_changes.html
|
||||
log.Println("[INFO] Initializing Route53 connection")
|
||||
client.r53conn = route53.New(creds, "us-east-1", nil)
|
||||
log.Println("[INFO] Initializing AWS-GO EC2 Connection")
|
||||
log.Println("[INFO] Initializing EC2 Connection")
|
||||
client.awsEC2conn = awsEC2.New(creds, c.Region, nil)
|
||||
}
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ func resourceAwsDbParameterGroupUpdate(d *schema.ResourceData, meta interface{})
|
|||
os := o.(*schema.Set)
|
||||
ns := n.(*schema.Set)
|
||||
|
||||
// Expand the "parameter" set to goamz compat []rds.Parameter
|
||||
// Expand the "parameter" set to aws-sdk-go compat []rds.Parameter
|
||||
parameters, err := expandParameters(ns.Difference(os).List())
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -161,7 +161,7 @@ func resourceAwsElb() *schema.Resource {
|
|||
func resourceAwsElbCreate(d *schema.ResourceData, meta interface{}) error {
|
||||
elbconn := meta.(*AWSClient).elbconn
|
||||
|
||||
// Expand the "listener" set to goamz compat []elb.Listener
|
||||
// Expand the "listener" set to aws-sdk-go compat []elb.Listener
|
||||
listeners, err := expandListeners(d.Get("listener").(*schema.Set).List())
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -4,11 +4,10 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/hashicorp/aws-sdk-go/aws"
|
||||
awsEC2 "github.com/hashicorp/aws-sdk-go/gen/ec2"
|
||||
"github.com/hashicorp/aws-sdk-go/gen/ec2"
|
||||
"github.com/hashicorp/aws-sdk-go/gen/elb"
|
||||
"github.com/hashicorp/aws-sdk-go/gen/rds"
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
"github.com/mitchellh/goamz/ec2"
|
||||
)
|
||||
|
||||
// Takes the result of flatmap.Expand for an array of listeners and
|
||||
|
@ -17,7 +16,7 @@ func expandListeners(configured []interface{}) ([]elb.Listener, error) {
|
|||
listeners := make([]elb.Listener, 0, len(configured))
|
||||
|
||||
// Loop over our configured listeners and create
|
||||
// an array of goamz compatabile objects
|
||||
// an array of aws-sdk-go compatabile objects
|
||||
for _, lRaw := range configured {
|
||||
data := lRaw.(map[string]interface{})
|
||||
|
||||
|
@ -40,10 +39,10 @@ func expandListeners(configured []interface{}) ([]elb.Listener, error) {
|
|||
|
||||
// Takes the result of flatmap.Expand for an array of ingress/egress
|
||||
// security group rules and returns EC2 API compatible objects
|
||||
func expandIPPerms(id string, configured []interface{}) []awsEC2.IPPermission {
|
||||
perms := make([]awsEC2.IPPermission, len(configured))
|
||||
func expandIPPerms(id string, configured []interface{}) []ec2.IPPermission {
|
||||
perms := make([]ec2.IPPermission, len(configured))
|
||||
for i, mRaw := range configured {
|
||||
var perm awsEC2.IPPermission
|
||||
var perm ec2.IPPermission
|
||||
m := mRaw.(map[string]interface{})
|
||||
|
||||
perm.FromPort = aws.Integer(m["from_port"].(int))
|
||||
|
@ -62,14 +61,14 @@ func expandIPPerms(id string, configured []interface{}) []awsEC2.IPPermission {
|
|||
}
|
||||
|
||||
if len(groups) > 0 {
|
||||
perm.UserIDGroupPairs = make([]awsEC2.UserIDGroupPair, len(groups))
|
||||
perm.UserIDGroupPairs = make([]ec2.UserIDGroupPair, len(groups))
|
||||
for i, name := range groups {
|
||||
ownerId, id := "", name
|
||||
if items := strings.Split(id, "/"); len(items) > 1 {
|
||||
ownerId, id = items[0], items[1]
|
||||
}
|
||||
|
||||
perm.UserIDGroupPairs[i] = awsEC2.UserIDGroupPair{
|
||||
perm.UserIDGroupPairs[i] = ec2.UserIDGroupPair{
|
||||
GroupID: aws.String(id),
|
||||
UserID: aws.String(ownerId),
|
||||
}
|
||||
|
@ -78,9 +77,9 @@ func expandIPPerms(id string, configured []interface{}) []awsEC2.IPPermission {
|
|||
|
||||
if raw, ok := m["cidr_blocks"]; ok {
|
||||
list := raw.([]interface{})
|
||||
perm.IPRanges = make([]awsEC2.IPRange, len(list))
|
||||
perm.IPRanges = make([]ec2.IPRange, len(list))
|
||||
for i, v := range list {
|
||||
perm.IPRanges[i] = awsEC2.IPRange{aws.String(v.(string))}
|
||||
perm.IPRanges[i] = ec2.IPRange{aws.String(v.(string))}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +95,7 @@ func expandParameters(configured []interface{}) ([]rds.Parameter, error) {
|
|||
parameters := make([]rds.Parameter, 0, len(configured))
|
||||
|
||||
// Loop over our configured parameters and create
|
||||
// an array of goamz compatabile objects
|
||||
// an array of aws-sdk-go compatabile objects
|
||||
for _, pRaw := range configured {
|
||||
data := pRaw.(map[string]interface{})
|
||||
|
||||
|
@ -139,7 +138,7 @@ func flattenSecurityGroups(list []ec2.UserSecurityGroup) []string {
|
|||
}
|
||||
|
||||
// Flattens an array of UserSecurityGroups into a []string
|
||||
func flattenSecurityGroupsSDK(list []awsEC2.UserIDGroupPair) []string {
|
||||
func flattenSecurityGroupsSDK(list []ec2.UserIDGroupPair) []string {
|
||||
result := make([]string, 0, len(list))
|
||||
for _, g := range list {
|
||||
result = append(result, *g.GroupID)
|
||||
|
|
|
@ -56,4 +56,4 @@ The following attributes are exported:
|
|||
|
||||
|
||||
## Notes
|
||||
You still have to accept the peering with the aws console, aws-cli or goamz
|
||||
You still have to accept the peering with the aws console, aws-cli or aws-sdk-go.
|
||||
|
|
Loading…
Reference in New Issue