Merge pull request #1784 from danawillow/is-1715

force send a bunch more fields in firewall
This commit is contained in:
Paddy 2018-07-17 00:06:20 -07:00 committed by GitHub
commit 4e0a4ef84b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View File

@ -418,6 +418,6 @@ func resourceFirewall(d *schema.ResourceData, meta interface{}) (*computeBeta.Fi
SourceServiceAccounts: convertStringSet(d.Get("source_service_accounts").(*schema.Set)),
TargetServiceAccounts: convertStringSet(d.Get("target_service_accounts").(*schema.Set)),
Disabled: d.Get("disabled").(bool),
ForceSendFields: []string{"Disabled"},
ForceSendFields: []string{"Disabled", "Allowed", "Denied", "SourceRanges", "SourceTags", "DestinationRanges", "TargetTags"},
}, nil
}

View File

@ -63,6 +63,11 @@ func TestAccComputeFirewall_update(t *testing.T) {
testAccCheckComputeFirewallApiVersion(&firewall),
),
},
{
ResourceName: "google_compute_firewall.foobar",
ImportState: true,
ImportStateVerify: true,
},
resource.TestStep{
Config: testAccComputeFirewall_update(networkName, firewallName),
Check: resource.ComposeTestCheckFunc(
@ -73,6 +78,24 @@ func TestAccComputeFirewall_update(t *testing.T) {
testAccCheckComputeFirewallApiVersion(&firewall),
),
},
{
ResourceName: "google_compute_firewall.foobar",
ImportState: true,
ImportStateVerify: true,
},
resource.TestStep{
Config: testAccComputeFirewall_basic(networkName, firewallName),
Check: resource.ComposeTestCheckFunc(
testAccCheckComputeFirewallExists(
"google_compute_firewall.foobar", &firewall),
testAccCheckComputeFirewallApiVersion(&firewall),
),
},
{
ResourceName: "google_compute_firewall.foobar",
ImportState: true,
ImportStateVerify: true,
},
},
})
}
@ -454,6 +477,7 @@ func testAccComputeFirewall_update(network, firewall string) string {
description = "Resource created for Terraform acceptance testing"
network = "${google_compute_network.foobar.self_link}"
source_tags = ["foo"]
target_tags = ["bar"]
allow {
protocol = "tcp"