Skip to content

Commit 3878d49

Browse files
authored
Merge pull request #81 from GoogleCloudPlatform/PM-Q1-2025
Q1 2025 - includes - NCC (VPC as a Spoke) - Vertex AI Workbench - App Engine - Standard Environment - Flexible Environment - Load Balancers - External Application - Alloy DB - Click to deploy - Support for PSC - MIG as a Consumer - Other fixes and patches
2 parents 801d603 + 089fba6 commit 3878d49

File tree

226 files changed

+17329
-789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+17329
-789
lines changed

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The project is structured into the following folders:
2020
├── bootstrap.tfvars
2121
├── organization.tfvars
2222
├── networking.tfvars
23-
├── networking-manual.tfvars
23+
├── producer-connectivity.tfvars
2424
├── producer
2525
├── alloydb
2626
├── cloudsql
@@ -30,20 +30,33 @@ The project is structured into the following folders:
3030
└── mrc
3131
├── consumer
3232
├── cloudrun
33-
└── gce
34-
└── security
33+
├── gce
34+
├── mig
35+
├── workbench
36+
├── severless
37+
├── appengine
38+
├── flexible
39+
├── standard
40+
├── cloudrun
41+
├── job
42+
├── service
43+
├── vpcaccessconnector
44+
├──security
3545
├── alloydb.tfvars
3646
├── cloudsql.tfvars
3747
├── gce.tfvars
38-
└── mrc.tfvars
48+
├── mig.tfvars
49+
├── mrc.tfvars
50+
└── workbench.tfvars
3951
├──execution
4052
├── 00-bootstrap
4153
├── 01-organization
4254
├── 02-networking
4355
├── 03-security
4456
├── 04-producer
45-
├── 05-networking-manual
46-
└── 06-consumer
57+
├── 05-producer-connectivity
58+
├── 06-consumer
59+
└── 07-consumer-load-balancing
4760
└──modules
4861
├── net-vpc
4962
└── psc_forwarding_rule
@@ -59,8 +72,9 @@ The project is structured into the following folders:
5972
* `02-networking`: Manages VPCs, subnets, Cloud HA VPN and other core networking components like PSA, SCP, Cloud NAT.
6073
* `03-security`: Configures firewalls and other security measures.
6174
* `04-producer`: Implements producer services like AlloyDB, Memorystore for Redis clusters, and Cloud SQL.
62-
* `05-networking-manual`: Implements networking services like Private Service Connectivity.
63-
* `06-consumer`: Implements consumer services like Google Compute Engine instances.
75+
* `05-producer-connectivity`: Implements networking services like Private Service Connectivity.
76+
* `06-consumer`: Implements consumer services like Google Compute Engine instances, Cloud Run, Workbench, AppEngine and Managed Instance Groups.
77+
* `07-consumer-load-balancing`: Implements load balancing services.
6478

6579
* `modules`: contains reusable Terraform modules.
6680

configuration/README.md

Lines changed: 110 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This directory serves as a centralized repository for all Terraform configuratio
1212
- MRC (mrc.tfvars)
1313
- Cloud SQL (sql.tfvars)
1414
- GCE (gce.tfvars)
15+
- Workbench (workbench.tfvars)
1516
- 04-producer stage
1617
- AlloyDB
1718
- alloydb.tfvars
@@ -37,21 +38,47 @@ This directory serves as a centralized repository for all Terraform configuratio
3738
- vertex-ai-online-endpoints.tfvars
3839
- config
3940
- endpoint.yaml.example
40-
- 05-networking-manual stage (networking-manual.tfvars)
41+
- 05-producer-connectivity stage (producer-connectivity.tfvars)
4142
- 06-consumer stage
4243
- GCE
4344
- gce.tfvars
4445
- config
4546
- instance.yaml.example
46-
- CloudRun
47-
- Job
48-
- cloudrunjob.tfvars
49-
- config
47+
- MIG
48+
- mig.tfvars
49+
- config
50+
- instance.yaml.example
51+
- Serverless
52+
- AppEngine
53+
- Flexible
54+
- appengineflexible.tfvars
55+
- config
56+
- instance1.yaml.example
57+
- Standard
58+
- appenginestandard.tfvars
59+
- config
60+
- instance1.yaml.example
61+
- CloudRun
62+
- Job
63+
- cloudrunjob.tfvars
64+
- config
5065
- instance.yaml.example
51-
- Service
52-
- cloudrunservice.tfvars
53-
- config
66+
- Service
67+
- cloudrunservice.tfvars
68+
- config
5469
- instance.yaml.example
70+
- VPCAccessConnector
71+
- Workbench
72+
- config
73+
- instance-lite.yaml.example
74+
- instance-expanded.yaml.example
75+
- 07-consumer-load-balancing stage
76+
- Application
77+
- External
78+
- external-application.tfvars
79+
- config
80+
- instance1.yaml.example
81+
- instance2.yaml.example
5582

5683

5784
# Usage
@@ -95,15 +122,15 @@ This would run the terraform plan based on the values for the variables declared
95122
**Example usage**
96123

97124
```
98-
bootstrap_project_id = "test-bootstrap-project"
99-
network_hostproject_id = "host-project-id"
100-
network_serviceproject_id = "consumer-project-id"
101-
organization_stage_administrator = ["example@example.com"]
102-
networking_stage_administrator = ["example@example.com"]
103-
security_stage_administrator = ["example@example.com"]
104-
producer_stage_administrator = ["example@example.com"]
105-
networking_manual_stage_administrator = ["example@example.com"]
106-
consumer_stage_administrator = ["example@example.com"]
125+
bootstrap_project_id = "test-bootstrap-project"
126+
network_hostproject_id = "host-project-id"
127+
network_serviceproject_id = "consumer-project-id"
128+
organization_stage_administrator = ["example@example.com"]
129+
networking_stage_administrator = ["example@example.com"]
130+
security_stage_administrator = ["example@example.com"]
131+
producer_stage_administrator = ["example@example.com"]
132+
producer_connectivity_stage_administrator = ["example@example.com"]
133+
consumer_stage_administrator = ["example@example.com"]
107134
```
108135

109136
## 01-organization
@@ -124,6 +151,12 @@ consumer_stage_administrator = ["example@example.com"]
124151
"aiplatform.googleapis.com",
125152
"container.googleapis.com",
126153
"run.googleapis.com",
154+
"appengine.googleapis.com",
155+
"cloudbuild.googleapis.com",
156+
"cloudresourcemanager.googleapis.com",
157+
"artifactregistry.googleapis.com",
158+
"notebooks.googleapis.com",
159+
"vpcaccess.googleapis.com",
127160
],
128161
},
129162
}
@@ -200,41 +233,81 @@ egress_rules = {
200233

201234
Producer specific configuration examples can be found under the `/config` folder of that specific producer. Such as for AlloyDB, the example would be in the folder `configuration/producer/AlloyDB/config/instance.yaml.example`.
202235

203-
## 05-networking-manual (networking-manual.tfvars)
204-
205-
Defined using `psc_endpoints` which is a list of PSC endpoint configurations consisting of:
206-
207-
1. `endpoint_project_id` : Consumer project ID (where the forwarding rule is created).
208-
209-
2. `producer_instance_project_id` : Project where the producer service such as Cloud SQL is created.
236+
## 05-producer-connectivity (producer-connectivity.tfvars)
210237

211-
2. `producer_instance_name` : Name of the producer service instance.
238+
The `producer-connectivity.tfvars` file defines configurations for Private Service Connect (PSC) endpoints. These endpoints enable connectivity between consumer and producer services, such as Cloud SQL, AlloyDB, or other targets.
212239

213-
3. `subnetwork_name` : this variable names the specific subnetwork within your Virtual Private Cloud (VPC) network from which the internal IP address for the PSC connection will be allocated.
240+
### Key Variables
214241

215-
4. `network_name` : VPC network for the forwarding rule which hosts the subnetwork mentioned above.
242+
1. `endpoint_project_id`: Consumer project ID where the forwarding rule is created.
243+
2. `producer_instance_project_id`: Project where the producer service (e.g., Cloud SQL, AlloyDB) is created.
244+
3. `subnetwork_name`: Name of the subnetwork within the VPC network from which the internal IP address for the PSC connection will be allocated.
245+
4. `network_name`: VPC network hosting the subnetwork mentioned above.
246+
5. `ip_address_literal`: **(Optional)** Specific internal IP address for the PSC connection. Leave null for automatic allocation.
247+
6. `region`: Region where the PSC endpoint is created.
248+
7. `producer_cloudsql`: **(Optional)** Configuration for Cloud SQL instances. Includes:
249+
- `instance_name`: Name of the Cloud SQL instance.
250+
8. `producer_alloydb`: **(Optional)** Configuration for AlloyDB instances. Includes:
251+
- `instance_name`: Name of the AlloyDB instance.
252+
- `cluster_id`: ID of the AlloyDB cluster.
253+
9. `target`: **(Optional)** Service attachment URL for other targets.
216254

217-
5. `ip_address_literal` : **(Optional)** Specific internal IP, or leave null for automatic allocation.
255+
### Example Usage
218256

219-
**Example Usage**
220-
221-
```
257+
```hcl
222258
psc_endpoints = [
259+
// Configuration for a PSC endpoint with a CloudSQL instance
223260
{
224-
endpoint_project_id = "endpoint-project-id"
225-
producer_instance_project_id = "instance-project-id"
226-
producer_instance_name = "sql-1"
261+
endpoint_project_id = "your-endpoint-project-id"
262+
producer_instance_project_id = "your-producer-instance-project-id"
227263
subnetwork_name = "subnetwork-1"
228264
network_name = "network-1"
229-
ip_address_literal = "10.128.0.50"
265+
ip_address_literal = "10.128.0.26"
266+
region = "us-central1"
267+
producer_cloudsql = {
268+
instance_name = "psc-instance-name"
269+
}
230270
},
231-
# Add more endpoint objects as needed
271+
// Configuration for a PSC endpoint with an AlloyDB instance
272+
{
273+
endpoint_project_id = "your-endpoint-project-id"
274+
producer_instance_project_id = "your-producer-instance-project-id"
275+
subnetwork_name = "subnetwork-2"
276+
network_name = "network-2"
277+
ip_address_literal = "10.128.0.27"
278+
region = "us-central2"
279+
producer_alloydb = {
280+
instance_name = "your-alloydb-instance-name"
281+
cluster_id = "your-cluster-id"
282+
}
283+
},
284+
// Configuration for a PSC endpoint with a target
285+
{
286+
endpoint_project_id = "your-endpoint-project-id"
287+
producer_instance_project_id = "your-producer-instance-project-id"
288+
subnetwork_name = "subnetwork-3"
289+
network_name = "network-3"
290+
ip_address_literal = "10.0.0.10"
291+
region = "us-central1"
292+
target = "projects/your-project-id/regions/us-central1/serviceAttachments/your-service-attachment-id"
293+
}
232294
]
233295
```
234296

297+
### Notes
298+
299+
- **Cloud SQL Configuration**: Use the `producer_cloudsql` block to specify the Cloud SQL instance name.
300+
- **AlloyDB Configuration**: Use the `producer_alloydb` block to specify the AlloyDB instance name and cluster ID.
301+
- **Target Configuration**: Use the `target` field to specify the service attachment URL for other targets.
302+
- Ensure that the `region` field is specified for all PSC endpoints to avoid deployment issues.
303+
235304
## 06-consumer
236305

237-
Consumer specific configuration examples can be found under the `/config` folder of that specific consumer. Such as for GCE, the example would be in the folder `configuration/consumer/GCE/config/instance.yaml.example`.
306+
Consumer specific configuration examples can be found under the `/config` folder of that specific consumer. Such as for GCE, the example would be in the folder `configuration/consumer/GCE/config/`.
307+
308+
## 07-consumer-load-balancing
309+
310+
Consumer load balancing specific configuration examples can be found under the `/config` folder of that specific load balancer. Such as for Application External Load Balancer, the example would be in the folder `configuration/consumer-load-balancing/Application/External/config/`.
238311

239312
## Considerations
240313

configuration/bootstrap.tfvars

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ producer_alloydb_administrator = ["user:user-example@example.com"]
1313
producer_vertex_administrator = ["user:user-example@example.com"]
1414
producer_mrc_administrator = ["user:user-example@example.com"]
1515

16-
networking_manual_administrator = ["user:user-example@example.com"]
16+
producer_connectivity_administrator = ["user:user-example@example.com"]
1717

18-
consumer_gce_administrator = ["user:user-example@example.com"]
19-
consumer_cloudrun_administrator = ["user:user-example@example.com"]
18+
consumer_gce_administrator = ["user:user-example@example.com"]
19+
consumer_cloudrun_administrator = ["user:user-example@example.com"]
20+
consumer_workbench_administrator = ["user:workbench-user-example@example.com"]
21+
consumer_mig_administrator = ["user:mig-user-example@example.com"]
22+
consumer_vpc_connector_administrator = ["user:user-example@example.com"]
23+
consumer_appengine_administrator = ["user:user-example@example.com"]
24+
consumer_load_balacing_administrator = ["user:user-example@example.com"]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: <load-balancer-name>
2+
project: <project-id>
3+
network: <network-name>
4+
backends:
5+
default:
6+
protocol: "HTTP"
7+
port: 80
8+
port_name: "http"
9+
timeout_sec: 30
10+
enable_cdn: false
11+
health_check:
12+
request_path: "/healthz"
13+
port: 80
14+
log_config:
15+
enable: true
16+
sample_rate: 0.5
17+
groups:
18+
- group: <instance-group-name>
19+
region : <region>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: <load-balancer-name>
2+
project: <project-id>
3+
network: <network-name>
4+
backends:
5+
default:
6+
groups:
7+
- group: <instance-group-name>
8+
region: <region>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#Location of YAML files holding LB configuration values.
2+
config_folder_path = "../../../../configuration/consumer-load-balancing/Application/External/config/"

configuration/consumer/CloudRun/Job/cloudrunjob.tfvars

Lines changed: 0 additions & 2 deletions
This file was deleted.

configuration/consumer/CloudRun/Service/cloudrunservice.tfvars

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: minimal-mig
2+
project_id: <project-id>
3+
location: <region> E.g. : us-central1
4+
zone : <zone> E.g. : us-central1-a
5+
vpc_name : <network-name>
6+
subnetwork_name : <subnetwork-name>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#Location of YAML files holding GCE configuration values.
2+
config_folder_path = "../../../configuration/consumer/MIG/config/"

0 commit comments

Comments
 (0)