Skip to content

Commit 13cd185

Browse files
committed
update firewall submodule README
1 parent 3d342c5 commit 13cd185

File tree

1 file changed

+41
-3
lines changed

1 file changed

+41
-3
lines changed

modules/fabric-net-firewall/README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1-
# Google Cloud Simple VPC Firewall Creation
1+
# Google Cloud VPC Firewall
22

3-
This module allows creation of a minimal VPC firewall, supporting basic configurable rules for IP range-based intra-VPC and administrator ingress, and tag-based SSH, HTTP, and HTTPS ingress.
3+
This module allows creation of a minimal VPC firewall, supporting basic configurable rules for IP range-based intra-VPC and administrator ingress, tag-based SSH/HTTP/HTTPS ingress, and custom rule definitions.
44

5-
The HTTP and HTTPS rules use the same network tags network tags that are assigned to instances when flaggging the "Allow HTTP[S] traffic" checkbox in the Cloud Console. The SSH rule uses a generic `ssh` tag.
5+
The HTTP and HTTPS rules use the same network tags that are assigned to instances when the "Allow HTTP[S] traffic" checkbox is flagged in the Cloud Console. The SSH rule uses a generic `ssh` tag.
66

77
All IP source ranges are configurable through variables, and are set by default to `0.0.0.0/0` for tag-based rules. Allowed protocols and/or ports for the intra-VPC rule are also configurable through a variable.
88

9+
Custom rules are set through a map where key is the rule name, and values must match this custom type:
10+
11+
```hcl
12+
map(object({
13+
description = string
14+
direction = string # (INGRESS|EGRESS)
15+
action = string # (allow|deny)
16+
ranges = list(string) # list of IP CIDR ranges
17+
sources = list(string) # tags or SAs (ignored for EGRESS)
18+
targets = list(string) # tags or SAs
19+
use_service_accounts = bool # defaults to false
20+
rules = list(object({
21+
protocol = string
22+
ports = list(string)
23+
}))
24+
extra_attributes = map(string) # map, optional keys disabled or priority
25+
}))
26+
```
27+
928
The resources created/managed by this module are:
1029

1130
- one optional ingress rule from internal CIDR ranges, only allowing ICMP by default
1231
- one optional ingress rule from admin CIDR ranges, allowing all protocols on all ports
1332
- one optional ingress rule for SSH on network tag `ssh`
1433
- one optional ingress rule for HTTP on network tag `http-server`
1534
- one optional ingress rule for HTTPS on network tag `https-server`
35+
- one or more optional custom rules
1636

1737

1838
## Usage
@@ -26,6 +46,24 @@ module "net-firewall" {
2646
network = "my-vpc"
2747
internal_ranges_enabled = true
2848
internal_ranges = ["10.0.0.0/0"]
49+
custom_rules = {
50+
ingress-sample = {
51+
description = "Dummy sample ingress rule, tag-based."
52+
direction = "INGRESS"
53+
action = "allow"
54+
ranges = ["192.168.0.0"]
55+
sources = ["spam-tag"]
56+
targets = ["foo-tag", "egg-tag"]
57+
use_service_accounts = false
58+
rules = [
59+
{
60+
protocol = "tcp"
61+
ports = []
62+
}
63+
]
64+
extra_attributes = {}
65+
}
66+
}
2967
}
3068
```
3169

0 commit comments

Comments
 (0)