@@ -25,12 +25,11 @@ To get more information about Environments, see:
25
25
* [ Connect an environment to a VPC network] ( https://cloud.google.com/composer/docs/composer-3/connect-vpc-network )
26
26
* [ Apache Airflow Documentation] ( http://airflow.apache.org/ )
27
27
28
- < Note >
28
+ -> ** Note **
29
29
Cloud Composer 1 is in the post-maintenance mode. Google does
30
30
not release any further updates to Cloud Composer 1, including new versions
31
31
of Airflow, bugfixes, and security updates. We recommend using
32
32
Cloud Composer 2 or Cloud Composer 3 instead.
33
- </Note >
34
33
35
34
Several special considerations apply to managing Cloud Composer environments
36
35
with Terraform:
@@ -92,18 +91,16 @@ resource "google_composer_environment" "test" {
92
91
}
93
92
```
94
93
95
-
96
94
### With GKE and Compute Resource Dependencies
97
95
98
- < Note >
96
+ -> ** Note **
99
97
To use custom service accounts, you must give at least the
100
98
` role/composer.worker ` role to the service account of the Cloud Composer
101
99
environment. For more information, see the
102
100
[ Access Control] ( https://cloud.google.com/composer/docs/how-to/access-control )
103
101
page in the Cloud Composer documentation.
104
102
You might need to assign additional roles depending on specific workflows
105
103
that the Airflow DAGs will be running.
106
- <Note >
107
104
108
105
#### GKE and Compute Resource Dependencies (Cloud Composer 3)
109
106
@@ -302,6 +299,69 @@ resource "google_project_iam_member" "composer-worker" {
302
299
}
303
300
```
304
301
302
+ ### Cloud Composer 3 networking configuration
303
+
304
+ In Cloud Composer 3, networking configuration is simplified compared to
305
+ previous versions. You don't need to specify network ranges, and can attach
306
+ custom VPC networks to your environment.
307
+
308
+ -> ** Note**
309
+ It's not possible to detach a VPC network using Terraform. Instead, you can
310
+ attach a different VPC network in its place, or detach the network using
311
+ other tools like Google Cloud CLI.
312
+
313
+ Use Private IP networking:
314
+
315
+ ``` hcl
316
+ resource "google_composer_environment" "example" {
317
+ name = "example-environment"
318
+ region = "us-central1"
319
+
320
+ config {
321
+
322
+ enable_private_ip_environment = true
323
+
324
+ # ... other configuration parameters
325
+ }
326
+ }
327
+ ```
328
+
329
+ Attach a custom VPC network (Cloud Composer creates a new network attachment):
330
+
331
+ ``` hcl
332
+ resource "google_composer_environment" "example" {
333
+ name = "example-environment"
334
+ region = "us-central1"
335
+
336
+ config {
337
+
338
+ node_config {
339
+ network = "projects/example-project/global/networks/example-network"
340
+ subnetwork = "projects/example-project/regions/us-central1/subnetworks/example-subnetwork"
341
+ }
342
+
343
+ # ... other configuration parameters
344
+ }
345
+ }
346
+ ```
347
+
348
+ Attach a custom VPC network (use existing network attachment):
349
+
350
+ ``` hcl
351
+ resource "google_composer_environment" "example" {
352
+ name = "example-environment"
353
+ region = "us-central1"
354
+
355
+ config {
356
+
357
+ node_config {
358
+ composer_network_attachment = projects/example-project/regions/us-central1/networkAttachments/example-network-attachment
359
+ }
360
+
361
+ # ... other configuration parameters
362
+ }
363
+ }
364
+ ```
305
365
306
366
### With Software (Airflow) Config
307
367
@@ -327,6 +387,7 @@ resource "google_composer_environment" "test" {
327
387
}
328
388
}
329
389
```
390
+
330
391
## Argument Reference - Cloud Composer 1
331
392
332
393
The following arguments are supported:
0 commit comments