providers/aws: fix order of ingress rules on security group
This commit is contained in:
parent
dbe6b74884
commit
6653542466
|
@ -49,8 +49,8 @@ func resource_aws_security_group_create(
|
||||||
|
|
||||||
// Wait for the security group to truly exist
|
// Wait for the security group to truly exist
|
||||||
log.Printf(
|
log.Printf(
|
||||||
"[DEBUG] Waiting for SG (%s) to exist",
|
"[DEBUG] Waiting for Security Group (%s) to exist",
|
||||||
s.ID)
|
rs.ID)
|
||||||
stateConf := &resource.StateChangeConf{
|
stateConf := &resource.StateChangeConf{
|
||||||
Pending: []string{""},
|
Pending: []string{""},
|
||||||
Target: "exists",
|
Target: "exists",
|
||||||
|
@ -59,7 +59,7 @@ func resource_aws_security_group_create(
|
||||||
}
|
}
|
||||||
if _, err := stateConf.WaitForState(); err != nil {
|
if _, err := stateConf.WaitForState(); err != nil {
|
||||||
return s, fmt.Errorf(
|
return s, fmt.Errorf(
|
||||||
"Error waiting for SG (%s) to become available: %s",
|
"Error waiting for Security Group (%s) to become available: %s",
|
||||||
rs.ID, err)
|
rs.ID, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +175,9 @@ func resource_aws_security_group_update_state(
|
||||||
n["security_groups"] = flattenSecurityGroups(perm.SourceGroups)
|
n["security_groups"] = flattenSecurityGroups(perm.SourceGroups)
|
||||||
}
|
}
|
||||||
|
|
||||||
ingressRules = append(ingressRules, n)
|
// Reverse the order, as Amazon sorts it the reverse of how we created
|
||||||
|
// it.
|
||||||
|
ingressRules = append([]map[string]interface{}{n}, ingressRules...)
|
||||||
}
|
}
|
||||||
|
|
||||||
toFlatten["ingress"] = ingressRules
|
toFlatten["ingress"] = ingressRules
|
||||||
|
|
|
@ -262,8 +262,8 @@ resource "aws_security_group" "web" {
|
||||||
|
|
||||||
ingress {
|
ingress {
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
from_port = 80
|
from_port = 22
|
||||||
to_port = 8000
|
to_port = 22
|
||||||
cidr_blocks = ["10.0.0.0/8"]
|
cidr_blocks = ["10.0.0.0/8"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue