Merge pull request #1597 from aocsolutions/fix_sg_refresh

provider/aws: more careful with pointers
This commit is contained in:
Mitchell Hashimoto 2015-04-22 08:12:43 +02:00
commit 2996a25ce0
1 changed files with 3 additions and 3 deletions

View File

@ -320,12 +320,12 @@ func resourceAwsSecurityGroupRuleHash(v interface{}) int {
func resourceAwsSecurityGroupIPPermGather(d *schema.ResourceData, permissions []*ec2.IPPermission) []map[string]interface{} { func resourceAwsSecurityGroupIPPermGather(d *schema.ResourceData, permissions []*ec2.IPPermission) []map[string]interface{} {
ruleMap := make(map[string]map[string]interface{}) ruleMap := make(map[string]map[string]interface{})
for _, perm := range permissions { for _, perm := range permissions {
var fromPort, toPort *int64 var fromPort, toPort int64
if v := perm.FromPort; v != nil { if v := perm.FromPort; v != nil {
fromPort = v fromPort = *v
} }
if v := perm.ToPort; v != nil { if v := perm.ToPort; v != nil {
toPort = v toPort = *v
} }
k := fmt.Sprintf("%s-%d-%d", *perm.IPProtocol, fromPort, toPort) k := fmt.Sprintf("%s-%d-%d", *perm.IPProtocol, fromPort, toPort)