Code cleanup
This commit is contained in:
parent
3977256c17
commit
902ca25f36
|
@ -320,15 +320,11 @@ func resourceAwsSecurityGroupIPPermGather(d *schema.ResourceData, permissions []
|
||||||
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 int
|
var fromPort, toPort int
|
||||||
if perm.FromPort == nil {
|
if v := perm.FromPort; v != nil {
|
||||||
fromPort = 0
|
fromPort = *v
|
||||||
} else {
|
|
||||||
fromPort = *perm.FromPort
|
|
||||||
}
|
}
|
||||||
if perm.ToPort == nil {
|
if v := perm.ToPort; v != nil {
|
||||||
toPort = 0
|
toPort = *v
|
||||||
} else {
|
|
||||||
toPort = *perm.ToPort
|
|
||||||
}
|
}
|
||||||
|
|
||||||
k := fmt.Sprintf("%s-%d-%d", *perm.IPProtocol, fromPort, toPort)
|
k := fmt.Sprintf("%s-%d-%d", *perm.IPProtocol, fromPort, toPort)
|
||||||
|
|
Loading…
Reference in New Issue