Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions mmv1/products/compute/RegionNetworkFirewallPolicyRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ examples:
org_id: 'ORG_ID'
project_name: 'PROJECT_NAME'
region: 'REGION'
- name: 'firewall_policy_rule_target_type_internal_managed_lb_instance_regional'
primary_resource_id: 'internal_managed_lb_rule'
min_version: "beta"
vars:
folder: 'folder'
fw_policy: 'fw-policy'
test_env_vars:
org_id: 'ORG_ID'
parameters:
- name: 'firewallPolicy'
type: ResourceRef
Expand Down Expand Up @@ -397,3 +405,28 @@ properties:
Denotes whether the firewall policy rule is disabled.
When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist.
If this is unspecified, the firewall policy rule will be enabled.
- name: 'targetType'
type: Enum
description: |
Target types of the firewall policy rule.
Default value is INSTANCES.
When target_type is INTERNAL_MANAGED_LB, target_forwarding_rules must be set
required: false
Comment thread
ScottSuarez marked this conversation as resolved.
default_from_api: true
enum_values:
- 'INSTANCES'
- 'INTERNAL_MANAGED_LB'
- name: 'targetForwardingRules'
type: Array
required: false
description: |
A list of forwarding rules to which this rule applies.
This field allows you to control which load balancers get this rule.
For example, the following are valid values:
- https://www.googleapis.com/compute/v1/projects/project/global/forwardingRules/forwardingRule
- https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule
- projects/project/global/forwardingRules/forwardingRule
- projects/project/regions/region/forwardingRules/forwardingRule
item_type:
type: String
diff_suppress_func: 'tpgresource.CompareSelfLinkRelativePaths'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
resource "google_compute_network" "net" {
provider = google-beta
name = "test-net"
auto_create_subnetworks = false
}

resource "google_compute_region_network_firewall_policy" "fw_policy" {
provider = google-beta
name = "simple-fw-policy"
region = "us-central1"
}

resource "google_compute_region_network_firewall_policy_association" "assoc" {
provider = google-beta
name = "fw-policy-assoc"
region = "us-central1"
firewall_policy = google_compute_region_network_firewall_policy.fw_policy.id
attachment_target = google_compute_network.net.self_link
}

resource "google_compute_region_network_firewall_policy_rule" "internal_managed_lb_rule" {
provider = google-beta
region = "us-central1"
firewall_policy = google_compute_region_network_firewall_policy.fw_policy.name
priority = 1000
action = "allow"
direction = "INGRESS"

target_type = "INTERNAL_MANAGED_LB"

match {
src_ip_ranges = ["10.0.0.0/8"]

layer4_configs {
ip_protocol = "tcp"
}
}
}