Expand on an error case with more descriptive error
This commit is contained in:
parent
e0bb04b822
commit
03aac9f42b
|
@ -27,19 +27,19 @@ func resourceAwsEip() *schema.Resource {
|
|||
ForceNew: true,
|
||||
},
|
||||
|
||||
"instance": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
"instance": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"network_interface": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
"network_interface": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"allocation_id": &schema.Schema{
|
||||
"allocation_id": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
|
|
@ -171,7 +171,9 @@ func resourceAwsSecurityGroupRuleRead(d *schema.ResourceData, meta interface{})
|
|||
p := expandIPPerm(d, sg)
|
||||
|
||||
if len(rules) == 0 {
|
||||
return fmt.Errorf("No IPPerms")
|
||||
return fmt.Errorf(
|
||||
"[WARN] No %s rules were found for Security Group (%s) looking for Security Group Rule (%s)",
|
||||
ruleType, *sg.GroupName, d.Id())
|
||||
}
|
||||
|
||||
for _, r := range rules {
|
||||
|
@ -198,7 +200,7 @@ func resourceAwsSecurityGroupRuleRead(d *schema.ResourceData, meta interface{})
|
|||
|
||||
if remaining > 0 {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
remaining = len(p.UserIdGroupPairs)
|
||||
for _, ip := range p.UserIdGroupPairs {
|
||||
|
@ -211,7 +213,7 @@ func resourceAwsSecurityGroupRuleRead(d *schema.ResourceData, meta interface{})
|
|||
|
||||
if remaining > 0 {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("[DEBUG] Found rule for Security Group Rule (%s): %s", d.Id(), r)
|
||||
rule = r
|
||||
|
|
|
@ -257,7 +257,7 @@ func TestAccAWSSecurityGroupRule_SelfReference(t *testing.T) {
|
|||
}
|
||||
|
||||
// testing partial match implementation
|
||||
func TestAccAWSSecurityGroupRule_PartialMatching_Basic(t *testing.T) {
|
||||
func TestAccAWSSecurityGroupRule_PartialMatching_basic(t *testing.T) {
|
||||
var group ec2.SecurityGroup
|
||||
|
||||
p := ec2.IpPermission{
|
||||
|
|
Loading…
Reference in New Issue