Merge pull request #12735 from hashicorp/b-fix-network-acls

provider/aws: Correctly check if setting CidrBlock or IPv6CidrBlock i…
This commit is contained in:
Jake Champlin 2017-03-16 10:21:25 -04:00 committed by GitHub
commit 3641c944a6
2 changed files with 5 additions and 5 deletions

View File

@ -23,11 +23,11 @@ func TestAccAWSNetworkAcl_importBasic(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccAWSNetworkAclEgressNIngressConfig,
},
resource.TestStep{
{
ResourceName: "aws_network_acl.bar",
ImportState: true,
ImportStateVerify: true,

View File

@ -397,7 +397,7 @@ func updateNetworkAclEntries(d *schema.ResourceData, entryType string, conn *ec2
}
}
if add.CidrBlock != nil {
if add.CidrBlock != nil && *add.CidrBlock != "" {
// AWS mutates the CIDR block into a network implied by the IP and
// mask provided. This results in hashing inconsistencies between
// the local config file and the state returned by the API. Error
@ -417,11 +417,11 @@ func updateNetworkAclEntries(d *schema.ResourceData, entryType string, conn *ec2
IcmpTypeCode: add.IcmpTypeCode,
}
if add.CidrBlock != nil {
if add.CidrBlock != nil && *add.CidrBlock != "" {
createOpts.CidrBlock = add.CidrBlock
}
if add.Ipv6CidrBlock != nil {
if add.Ipv6CidrBlock != nil && *add.Ipv6CidrBlock != "" {
createOpts.Ipv6CidrBlock = add.Ipv6CidrBlock
}