@@ -181,8 +181,9 @@ func TestAccComputeNetworkFirewallPolicyRule_securityProfileGroup_update(t *test
181
181
t .Parallel ()
182
182
183
183
context := map [string ]interface {}{
184
- "random_suffix" : acctest .RandString (t , 10 ),
185
- "org_name" : fmt .Sprintf ("organizations/%s" , envvar .GetTestOrgFromEnv (t )),
184
+ "random_suffix" : acctest .RandString (t , 10 ),
185
+ "org_name" : fmt .Sprintf ("organizations/%s" , envvar .GetTestOrgFromEnv (t )),
186
+ "security_profile_group_prefix" : "//" ,
186
187
}
187
188
188
189
acctest .VcrTest (t , resource.TestCase {
@@ -262,6 +263,33 @@ func TestAccComputeNetworkFirewallPolicyRule_secureTags(t *testing.T) {
262
263
})
263
264
}
264
265
266
+ func TestAccComputeNetworkFirewallSecurityProfileGroupDiffsuppress (t * testing.T ) {
267
+ t .Parallel ()
268
+
269
+ context := map [string ]interface {}{
270
+ "random_suffix" : acctest .RandString (t , 10 ),
271
+ "org_name" : fmt .Sprintf ("organizations/%s" , envvar .GetTestOrgFromEnv (t )),
272
+ "security_profile_group_prefix" : "/" ,
273
+ }
274
+
275
+ acctest .VcrTest (t , resource.TestCase {
276
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
277
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
278
+ Steps : []resource.TestStep {
279
+ {
280
+ Config : testAccComputeNetworkFirewallPolicyRule_securityProfileGroup_update (context ),
281
+ },
282
+ {
283
+ ResourceName : "google_compute_network_firewall_policy_rule.fw_policy_rule1" ,
284
+ ImportState : true ,
285
+ ImportStateVerify : true ,
286
+ // Referencing using ID causes import to fail
287
+ ImportStateVerifyIgnore : []string {"firewall_policy" },
288
+ },
289
+ },
290
+ })
291
+ }
292
+
265
293
func testAccComputeNetworkFirewallPolicyRule_secureTags (context map [string ]interface {}) string {
266
294
return acctest .Nprintf (`
267
295
resource "google_network_security_address_group" "basic_global_networksecurity_address_group" {
@@ -493,7 +521,7 @@ resource "google_compute_network_firewall_policy_rule" "fw_policy_rule1" {
493
521
priority = 9000
494
522
enable_logging = true
495
523
action = "apply_security_profile_group"
496
- security_profile_group = "// networksecurity.googleapis.com/${google_network_security_security_profile_group.security_profile_group_updated.id}"
524
+ security_profile_group = "%{security_profile_group_prefix} networksecurity.googleapis.com/${google_network_security_security_profile_group.security_profile_group_updated.id}"
497
525
direction = "INGRESS"
498
526
disabled = false
499
527
match {
0 commit comments