Skip to content

Commit

Permalink
resource/aws_network_acl: Fix issue with updating subnet associations…
Browse files Browse the repository at this point in the history
… returning InvalidAssociationID.NotFound (#13382)

Output from acceptance testing:

```
--- PASS: TestAccAWSNetworkAcl_basic (37.40s)
--- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (51.54s)
--- PASS: TestAccAWSNetworkAcl_disappears (22.76s)
--- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (75.61s)
--- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (60.15s)
--- PASS: TestAccAWSNetworkAcl_espProtocol (18.73s)
--- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (97.83s)
--- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (36.94s)
--- PASS: TestAccAWSNetworkAcl_ipv6Rules (45.59s)
--- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (27.91s)
--- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (56.36s)
--- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (52.51s)
--- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (53.47s)
--- PASS: TestAccAWSNetworkAcl_SubnetChange (67.85s)
--- PASS: TestAccAWSNetworkAcl_Subnets (50.49s)
--- PASS: TestAccAWSNetworkAcl_SubnetsDelete (40.37s)
```
  • Loading branch information
scottclk authored May 20, 2020
1 parent 322c917 commit c5d2343
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aws/resource_aws_network_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,16 @@ func resourceAwsNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error
}
return fmt.Errorf("Failed to find acl association: acl %s with subnet %s: %s", d.Id(), r, err)
}
log.Printf("DEBUG] Replacing Network Acl Association (%s) with Default Network ACL ID (%s)", *association.NetworkAclAssociationId, *defaultAcl.NetworkAclId)
log.Printf("[DEBUG] Replacing Network Acl Association (%s) with Default Network ACL ID (%s)", *association.NetworkAclAssociationId, *defaultAcl.NetworkAclId)
_, err = conn.ReplaceNetworkAclAssociation(&ec2.ReplaceNetworkAclAssociationInput{
AssociationId: association.NetworkAclAssociationId,
NetworkAclId: defaultAcl.NetworkAclId,
})
if err != nil {
return err
if isAWSErr(err, "InvalidAssociationID.NotFound", "") {
continue
}
return fmt.Errorf("Error Replacing Default Network Acl Association: %s", err)
}
}
}
Expand Down

0 comments on commit c5d2343

Please sign in to comment.