Skip to content

Commit

Permalink
Merge pull request #1784 from danawillow/is-1715
Browse files Browse the repository at this point in the history
force send a bunch more fields in firewall
  • Loading branch information
paddycarver authored Jul 17, 2018
2 parents 24396c9 + 335ccae commit 4e0a4ef
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion google/resource_compute_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
24 changes: 24 additions & 0 deletions google/resource_compute_firewall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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,
},
},
})
}
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 4e0a4ef

Please sign in to comment.