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:
commit
3641c944a6
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue