You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example illustrates how to use the `composer` V2 module to deploy private composer environment with private service connect (PSC) endpoint to connect network attachments.
4
+
5
+
This example also creates a Cloud Storage Bucket for scheduled snapshots and assign appropriate permission(s) to Composer Service Account on the bucket.
6
+
7
+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
8
+
## Inputs
9
+
10
+
| Name | Description | Type | Default | Required |
| airflow\_config\_overrides | Airflow configuration properties to override. Property keys contain the section and property names, separated by a hyphen, for example "core-dags\_are\_paused\_at\_creation". |`map(string)`|`{}`| no |
67
-
| cloud\_composer\_connection\_subnetwork | Subnetwork self-link. When specified, the environment will use Private Service Connect instead of VPC peerings to connect to CloudSQL in the Tenant Project. IP address of psc endpoint is allocated from this subnet |`string`|`null`| no |
68
-
| cloud\_composer\_network\_ipv4\_cidr\_block | The CIDR block from which IP range in tenant project will be reserved. Required if VPC peering is used to connect to CloudSql instead of PSC |`string`|`null`| no |
69
67
| cloud\_data\_lineage\_integration | Whether or not Dataplex data lineage integration is enabled. Cloud Composer environments in versions composer-2.1.2-airflow-..* and newer) |`bool`|`false`| no |
70
-
| cloud\_sql\_ipv4\_cidr | The CIDR block from which IP range in tenant project will be reserved for Cloud SQL private service access. Required if VPC peering is used to connect to CloudSql instead of PSC |`string`|`null`| no |
71
68
| composer\_env\_name | Name of Cloud Composer Environment |`string`| n/a | yes |
69
+
| composer\_network\_attachment\_name | Name for PSC (Private Service Connect) Network entry point. |`string`|`null`| no |
72
70
| composer\_service\_account | Service Account for running Cloud Composer. |`string`|`null`| no |
73
-
| enable\_ip\_masq\_agent | Deploys 'ip-masq-agent' daemon set in the GKE cluster and defines nonMasqueradeCIDRs equals to pod IP range so IP masquerading is used for all destination addresses, except between pods traffic. |`bool`|`false`| no |
74
-
| enable\_private\_endpoint | Configure private access to the cluster endpoint. If true, access to the public endpoint of the GKE cluster is denied |`bool`|`false`| no |
75
-
| enable\_privately\_used\_public\_ips | When enabled, IPs from public (non-RFC1918) ranges can be used for pod\_ip\_allocation\_range\_name and service\_ip\_allocation\_range\_name. |`bool`|`false`| no |
71
+
| create\_network\_attachment | Either create a new network attachment or use existing one. If true, provide the subnet details. |`bool`|`true`| no |
72
+
| dag\_processor | Configuration for resources used by Airflow workers. | <pre>object({<br> cpu = string<br> memory_gb = number<br> storage_gb = number<br> count = number<br> })</pre> | <pre>{<br> "count": 2,<br> "cpu": 2,<br> "memory_gb": 7.5,<br> "storage_gb": 5<br>}</pre> | no |
76
73
| env\_variables | Variables of the airflow environment. |`map(string)`|`{}`| no |
77
74
| environment\_size | The environment size controls the performance parameters of the managed Cloud Composer infrastructure that includes the Airflow database. Values for environment size are: `ENVIRONMENT_SIZE_SMALL`, `ENVIRONMENT_SIZE_MEDIUM`, and `ENVIRONMENT_SIZE_LARGE`. |`string`|`"ENVIRONMENT_SIZE_MEDIUM"`| no |
78
75
| grant\_sa\_agent\_permission | Cloud Composer relies on Workload Identity as Google API authentication mechanism for Airflow. |`bool`|`true`| no |
79
-
| image\_version | The version of the aiflow running in the cloud composer environment. |`string`|`"composer-2.10.2-airflow-2.10.2"`| no |
76
+
| image\_version | The version of the aiflow running in the cloud composer environment. |`string`|`"composer-3-airflow-2.10.2-build.5"`| no |
80
77
| kms\_key\_name | Customer-managed Encryption Key fully qualified resource name, i.e. projects/project-id/locations/location/keyRings/keyring/cryptoKeys/key. |`string`|`null`| no |
81
78
| labels | The resource labels (a map of key/value pairs) to be applied to the Cloud Composer. |`map(string)`|`{}`| no |
82
79
| maintenance\_end\_time | Time window specified for recurring maintenance operations in RFC3339 format |`string`|`null`| no |
83
80
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. |`string`|`null`| no |
84
81
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format |`string`|`"05:00"`| no |
85
-
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | <pre>list(object({<br> cidr_block = string<br> display_name = string<br> }))</pre> |`[]`| no |
86
-
| master\_ipv4\_cidr | The CIDR block from which IP range in tenant project will be reserved for the GKE master. Required when `use_private_environment` and `enable_private_endpoint` is `true`|`string`|`null`| no |
87
82
| network | The VPC network to host the composer cluster. |`string`| n/a | yes |
88
83
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) |`string`|`""`| no |
89
-
| pod\_ip\_allocation\_range\_name | The name of the subnet secondary range, used to allocate IP addresses for the pods. |`string`|`null`| no |
90
84
| project\_id | Project ID where Cloud Composer Environment is created. |`string`| n/a | yes |
91
85
| pypi\_packages | Custom Python Package Index (PyPI) packages to be installed in the environment. Keys refer to the lowercase package name (e.g. "numpy"). |`map(string)`|`{}`| no |
92
86
| region | Region where the Cloud Composer Environment is created. |`string`|`"us-central1"`| no |
93
87
| resilience\_mode | Cloud Composer 2.1.15 or newer only. The resilience mode states whether high resilience is enabled for the environment or not. Values for resilience mode are `HIGH_RESILIENCE` for high resilience and `STANDARD_RESILIENCE` for standard resilience |`string`|`null`| no |
94
88
| scheduled\_snapshots\_config | The recovery configuration settings for the Cloud Composer environment | <pre>object({<br> enabled = optional(bool, false)<br> snapshot_location = optional(string)<br> snapshot_creation_schedule = optional(string)<br> time_zone = optional(string)<br> })</pre> |`null`| no |
95
-
| scheduler | Configuration for resources used by Airflow schedulers. | <pre>object({<br> cpu = string<br> memory_gb = number<br> storage_gb = number<br> count = number<br> })</pre> | <pre>{<br> "count": 2,<br> "cpu": 2,<br> "memory_gb": 7.5,<br> "storage_gb": 5<br>}</pre> | no |
96
-
| service\_ip\_allocation\_range\_name | The name of the subnet secondary range, used to allocate IP addresses for the Services. |`string`|`null`| no |
89
+
| scheduler | Configuration for resources used by Airflow schedulers. | <pre>object({<br> cpu = string<br> memory_gb = number<br> storage_gb = number<br> count = number<br> })</pre> | <pre>{<br> "count": 2,<br> "cpu": 1,<br> "memory_gb": 4,<br> "storage_gb": 5<br>}</pre> | no |
97
90
| storage\_bucket | Name of an existing Cloud Storage bucket to be used by the environment |`string`|`null`| no |
98
91
| subnetwork | The name of the subnetwork to host the composer cluster. |`string`| n/a | yes |
99
92
| subnetwork\_region | The subnetwork region of the shared VPC's host (for shared vpc support) |`string`|`""`| no |
100
93
| tags | Tags applied to all nodes. Tags are used to identify valid sources or targets for network firewalls. |`set(string)`|`[]`| no |
101
94
| task\_logs\_retention\_storage\_mode | The mode of storage for Airflow workers task logs. Values for storage mode are CLOUD\_LOGGING\_ONLY to only store logs in cloud logging and CLOUD\_LOGGING\_AND\_CLOUD\_STORAGE to store logs in cloud logging and cloud storage. Cloud Composer 2.0.23 or newer only |`string`|`null`| no |
102
95
| triggerer | Configuration for resources used by Airflow triggerer | <pre>object({<br> cpu = string<br> memory_gb = number<br> count = number<br> })</pre> |`null`| no |
103
-
| use\_private\_environment | Create a private environment. |`bool`|`false`| no |
96
+
| use\_private\_environment | Create a private environment. If true, a private Composer environment will be created. |`bool`|`false`| no |
104
97
| web\_server | Configuration for resources used by Airflow web server. | <pre>object({<br> cpu = string<br> memory_gb = number<br> storage_gb = number<br> })</pre> | <pre>{<br> "cpu": 2,<br> "memory_gb": 7.5,<br> "storage_gb": 5<br>}</pre> | no |
105
98
| web\_server\_network\_access\_control | The network-level access control policy for the Airflow web server. If unspecified, no network-level access restrictions are applied | <pre>list(object({<br> allowed_ip_range = string<br> description = string<br> }))</pre> |`null`| no |
99
+
| web\_server\_plugins\_mode | Web server plugins configuration. Can be either 'ENABLED' or 'DISABLED'. Defaults to 'ENABLED'. |`string`|`"ENABLED"`| no |
106
100
| worker | Configuration for resources used by Airflow workers. | <pre>object({<br> cpu = string<br> memory_gb = number<br> storage_gb = number<br> min_count = number<br> max_count = number<br> })</pre> | <pre>{<br> "cpu": 2,<br> "max_count": 6,<br> "memory_gb": 7.5,<br> "min_count": 2,<br> "storage_gb": 5<br>}</pre> | no |
assert.Equal(fmt.Sprintf("projects/%s/locations/us-central1/environments/%s", projectID, composer.GetStringOutput("composer_env_name")), op.Get("name").String(), "Composer name is valid")
36
+
assert.Equal(composer.GetStringOutput("airflow_uri"), op.Get("config.airflowUri").String(), "AirflowUri is valid")
37
+
assert.Equal(composer.GetStringOutput("gcs_bucket"), op.Get("config.dagGcsPrefix").String(), "GCS-Dag is valid")
0 commit comments