Skip to content

Commit c560525

Browse files
authored
Merge pull request #2 from terraform-google-modules/master
update
2 parents a9fe558 + ca1bc01 commit c560525

File tree

24 files changed

+287
-51
lines changed

24 files changed

+287
-51
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ The routes list contains maps, where each object represents a route. For the nex
155155

156156
## Requirements
157157
### Installed Software
158-
- [Terraform](https://www.terraform.io/downloads.html) ~> 0.12.0
159-
- [Terraform Provider for GCP][terraform-provider-google] ~> 2.19.0
158+
- [Terraform](https://www.terraform.io/downloads.html) ~> 0.12.6
159+
- [Terraform Provider for GCP](https://github.com/terraform-providers/terraform-provider-google) ~> 2.19
160+
- [Terraform Provider for GCP Beta](https://github.com/terraform-providers/terraform-provider-google-beta) ~>
161+
2.19
160162
- [gcloud](https://cloud.google.com/sdk/gcloud/) >243.0.0
161163

162164
### Configure a Service Account

examples/delete_default_gateway_routes/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
*/
1616

1717
terraform {
18-
required_version = "~> 0.12.0"
18+
required_version = "~> 0.12.6"
1919
}

examples/multi_vpc/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
*/
1616

1717
terraform {
18-
required_version = "~> 0.12.0"
18+
required_version = "~> 0.12.6"
1919
}

examples/secondary_ranges/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
*/
1616

1717
terraform {
18-
required_version = "~> 0.12.0"
18+
required_version = "~> 0.12.6"
1919
}

examples/simple_project/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
*/
1616

1717
terraform {
18-
required_version = "~> 0.12.0"
18+
required_version = "~> 0.12.6"
1919
}

examples/simple_project_with_regional_network/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
*/
1616

1717
terraform {
18-
required_version = "~> 0.12.0"
18+
required_version = "~> 0.12.6"
1919
}

examples/submodule_firewall/main.tf

Lines changed: 78 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,96 @@ module "test-vpc-module" {
4848
]
4949
}
5050

51+
// Custom firewall rules
52+
locals {
53+
custom_rules = {
54+
// Example of custom tcp/udp rule
55+
deny-ingress-6534-6566 = {
56+
description = "Deny all INGRESS to port 6534-6566"
57+
direction = "INGRESS"
58+
action = "deny"
59+
ranges = ["0.0.0.0/0"] # source or destination ranges (depends on `direction`)
60+
use_service_accounts = false # if `true` targets/sources expect list of instances SA, if false - list of tags
61+
targets = null # target_service_accounts or target_tags depends on `use_service_accounts` value
62+
sources = null # source_service_accounts or source_tags depends on `use_service_accounts` value
63+
rules = [{
64+
protocol = "tcp"
65+
ports = ["6534-6566"]
66+
},
67+
{
68+
protocol = "udp"
69+
ports = ["6534-6566"]
70+
}]
71+
72+
extra_attributes = {
73+
disabled = true
74+
priority = 95
75+
}
76+
}
77+
78+
// Example how to allow connection from instances with `backend` tag, to instances with `databases` tag
79+
allow-backend-to-databases = {
80+
description = "Allow backend nodes connection to databases instances"
81+
direction = "INGRESS"
82+
action = "allow"
83+
ranges = null
84+
use_service_accounts = false
85+
targets = ["databases"] # target_tags
86+
sources = ["backed"] # source_tags
87+
rules = [{
88+
protocol = "tcp"
89+
ports = ["3306", "5432", "1521", "1433"]
90+
}]
91+
92+
extra_attributes = {}
93+
}
94+
95+
// Example how to allow connection from an instance with a given service account
96+
allow-all-admin-sa = {
97+
description = "Allow all traffic from admin sa instances"
98+
direction = "INGRESS"
99+
action = "allow"
100+
ranges = null
101+
use_service_accounts = true
102+
targets = null
103+
sources = ["[email protected]"]
104+
rules = [{
105+
protocol = "tcp"
106+
ports = null # all ports
107+
},
108+
{
109+
protocol = "udp"
110+
ports = null # all ports
111+
}
112+
]
113+
extra_attributes = {
114+
priority = 30
115+
}
116+
}
117+
}
118+
}
119+
120+
121+
51122
module "test-firewall-submodule" {
52123
source = "../../modules/fabric-net-firewall"
53124
project_id = var.project_id
54125
network = module.test-vpc-module.network_name
55126
internal_ranges_enabled = true
56127
internal_ranges = module.test-vpc-module.subnets_ips
57128

58-
internal_allow = [{
59-
protocol = "icmp"
129+
internal_allow = [
130+
{
131+
protocol = "icmp"
60132
},
61133
{
62-
protocol = "tcp"
134+
protocol = "tcp",
135+
ports = ["8080", "1000-2000"]
63136
},
64137
{
65138
protocol = "udp"
139+
# all ports will be opened if `ports` key isn't specified
66140
},
67141
]
142+
custom_rules = local.custom_rules
68143
}

examples/submodule_firewall/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
*/
1616

1717
terraform {
18-
required_version = "~> 0.12.0"
18+
required_version = "~> 0.12.6"
1919
}

examples/submodule_network_peering/main.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414
* limitations under the License.
1515
*/
1616

17+
provider "google" {
18+
version = "~> 2.19.0"
19+
}
20+
21+
provider "google-beta" {
22+
version = "~> 2.19.0"
23+
}
24+
25+
provider "null" {
26+
version = "~> 2.1"
27+
}
28+
1729
module "local-network" {
1830
source = "../../"
1931
project_id = var.project_id

examples/submodule_network_peering/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
*/
1616

1717
terraform {
18-
required_version = "~> 0.12.0"
18+
required_version = "~> 0.12.6"
1919
}

0 commit comments

Comments
 (0)