Skip to content

Add src_network_context and dest_network_context fields to firewall policy rules#16373

Open
mihhalj wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
mihhalj:network-context
Open

Add src_network_context and dest_network_context fields to firewall policy rules#16373
mihhalj wants to merge 4 commits intoGoogleCloudPlatform:mainfrom
mihhalj:network-context

Conversation

@mihhalj
Copy link
Contributor

@mihhalj mihhalj commented Feb 12, 2026

It adds new src_network_context and dest_network_context fields to firewall policy rule resources. Currently in beta there are src_network_scope and dest_network_scope fields - they are going to be replaced by src_network_context and dest_network_context but due to backward compatibility first we need to support both of them.

16373

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: added `dest_network_context`, `src_network_context` and `src_networks` fields to `google_compute_firewall_policy_rule` resource
compute: added `dest_network_context`, `src_network_context` and `src_networks` fields to `google_compute_network_firewall_policy_rule` resource
compute: added `dest_network_context`, `src_network_context` and `src_networks` fields to `google_compute_region_network_firewall_policy_rule` resource

@github-actions github-actions bot requested a review from rileykarson February 12, 2026 10:57
@github-actions
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@rileykarson, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@mihhalj mihhalj force-pushed the network-context branch 3 times, most recently from 6bdc096 to 5393466 Compare February 12, 2026 11:04
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 17 files changed, 1330 insertions(+), 6 deletions(-))
google-beta provider: Diff ( 16 files changed, 1281 insertions(+), 29 deletions(-))
terraform-google-conversion: Diff ( 3 files changed, 255 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_firewall_policy_rule (18 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_firewall_policy_rule" "primary" {
  match {
    dest_network_scope = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 16 files changed, 1330 insertions(+), 5 deletions(-))
google-beta provider: Diff ( 16 files changed, 1281 insertions(+), 29 deletions(-))
terraform-google-conversion: Diff ( 3 files changed, 255 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_firewall_policy_rule (18 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_firewall_policy_rule" "primary" {
  match {
    dest_network_scope = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1343
Passed tests: 1245
Skipped tests: 88
Affected tests: 10

Click here to see the affected service packages
  • compute

Action taken

Found 10 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeFirewallPolicyRule_basic
  • TestAccComputeFirewallPolicyRule_firewallPolicyRuleNetworkContextExample
  • TestAccComputeFirewallPolicyRule_update
  • TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextEgressExample
  • TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextIngressExample
  • TestAccComputeNetworkFirewallPolicyRule_update
  • TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextEgressExample
  • TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextIngressExample
  • TestAccComputeRegionNetworkFirewallPolicyRule_update
  • TestAccComputeRegionTargetHttpsProxy_update

Get to know how VCR tests work

1 similar comment
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1343
Passed tests: 1245
Skipped tests: 88
Affected tests: 10

Click here to see the affected service packages
  • compute

Action taken

Found 10 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeFirewallPolicyRule_basic
  • TestAccComputeFirewallPolicyRule_firewallPolicyRuleNetworkContextExample
  • TestAccComputeFirewallPolicyRule_update
  • TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextEgressExample
  • TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextIngressExample
  • TestAccComputeNetworkFirewallPolicyRule_update
  • TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextEgressExample
  • TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextIngressExample
  • TestAccComputeRegionNetworkFirewallPolicyRule_update
  • TestAccComputeRegionTargetHttpsProxy_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccComputeFirewallPolicyRule_basic [Error message] [Debug log]
TestAccComputeFirewallPolicyRule_firewallPolicyRuleNetworkContextExample [Error message] [Debug log]
TestAccComputeFirewallPolicyRule_update [Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextEgressExample [Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextIngressExample [Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_update [Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextEgressExample [Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextIngressExample [Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_update [Error message] [Debug log]
TestAccComputeRegionTargetHttpsProxy_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccComputeFirewallPolicyRule_basic [Error message] [Debug log]
TestAccComputeFirewallPolicyRule_firewallPolicyRuleNetworkContextExample [Error message] [Debug log]
TestAccComputeFirewallPolicyRule_update [Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextEgressExample [Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextIngressExample [Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_update [Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextEgressExample [Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextIngressExample [Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_update [Error message] [Debug log]
TestAccComputeRegionTargetHttpsProxy_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@mihhalj mihhalj marked this pull request as draft February 12, 2026 15:24
@mihhalj mihhalj marked this pull request as ready for review February 16, 2026 07:41
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 16 files changed, 1366 insertions(+), 5 deletions(-))
google-beta provider: Diff ( 16 files changed, 1317 insertions(+), 29 deletions(-))
terraform-google-conversion: Diff ( 3 files changed, 255 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_firewall_policy_rule (18 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_firewall_policy_rule" "primary" {
  match {
    dest_network_scope = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1349
Passed tests: 1251
Skipped tests: 88
Affected tests: 10

Click here to see the affected service packages
  • compute

Action taken

Found 10 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeFirewallPolicyRule_basic
  • TestAccComputeFirewallPolicyRule_firewallPolicyRuleNetworkContextExample
  • TestAccComputeFirewallPolicyRule_update
  • TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextEgressExample
  • TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextIngressExample
  • TestAccComputeNetworkFirewallPolicyRule_update
  • TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextEgressExample
  • TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextIngressExample
  • TestAccComputeRegionNetworkFirewallPolicyRule_update
  • TestAccComputeRegionTargetHttpsProxy_update

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccComputeFirewallPolicyRule_basic [Error message] [Debug log]
TestAccComputeFirewallPolicyRule_firewallPolicyRuleNetworkContextExample [Error message] [Debug log]
TestAccComputeFirewallPolicyRule_update [Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextEgressExample [Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_networkFirewallPolicyRuleNetworkContextIngressExample [Error message] [Debug log]
TestAccComputeNetworkFirewallPolicyRule_update [Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextEgressExample [Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_regionNetworkFirewallPolicyRuleNetworkContextIngressExample [Error message] [Debug log]
TestAccComputeRegionNetworkFirewallPolicyRule_update [Error message] [Debug log]
TestAccComputeRegionTargetHttpsProxy_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants