Skip to content

Commit 8a82c09

Browse files
modular-magicianScottSuarezgor-obr
authored andcommitted
Composer v2 (beta) (#9611) (#5181) (#10269)
Co-authored-by: Scott Suarez <ScottSuarez@google.com> Co-authored-by: Goran Obradovic <gobradovic@google.com> Co-authored-by: Scott Suarez <ScottMSuarez@gmail.com> Signed-off-by: Modular Magician <magic-modules@google.com> Co-authored-by: Scott Suarez <ScottSuarez@google.com> Co-authored-by: Goran Obradovic <gobradovic@google.com> Co-authored-by: Scott Suarez <ScottMSuarez@gmail.com>
1 parent 69a614c commit 8a82c09

File tree

3 files changed

+176
-59
lines changed

3 files changed

+176
-59
lines changed

.changelog/5181.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
composer: added support for composer v2 fields `workloads_config` and `cloud_composer_network_ipv4_cidr_block` to `composer_environment`
3+
```

google/resource_composer_environment.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func resourceComposerEnvironment() *schema.Resource {
106106
Optional: true,
107107
AtLeastOneOf: composerConfigKeys,
108108
ValidateFunc: validation.IntAtLeast(3),
109-
Description: `The number of nodes in the Kubernetes Engine cluster that will be used to run this environment.`,
109+
Description: `The number of nodes in the Kubernetes Engine cluster that will be used to run this environment. This field is supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*.`,
110110
},
111111
"node_config": {
112112
Type: schema.TypeList,
@@ -122,15 +122,15 @@ func resourceComposerEnvironment() *schema.Resource {
122122
Required: true,
123123
ForceNew: true,
124124
DiffSuppressFunc: compareSelfLinkOrResourceName,
125-
Description: `The Compute Engine zone in which to deploy the VMs running the Apache Airflow software, specified as the zone name or relative resource name (e.g. "projects/{project}/zones/{zone}"). Must belong to the enclosing environment's project and region.`,
125+
Description: `The Compute Engine zone in which to deploy the VMs running the Apache Airflow software, specified as the zone name or relative resource name (e.g. "projects/{project}/zones/{zone}"). Must belong to the enclosing environment's project and region. This field is supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*.`,
126126
},
127127
"machine_type": {
128128
Type: schema.TypeString,
129129
Computed: true,
130130
Optional: true,
131131
ForceNew: true,
132132
DiffSuppressFunc: compareSelfLinkOrResourceName,
133-
Description: `The Compute Engine machine type used for cluster instances, specified as a name or relative resource name. For example: "projects/{project}/zones/{zone}/machineTypes/{machineType}". Must belong to the enclosing environment's project and region/zone.`,
133+
Description: `The Compute Engine machine type used for cluster instances, specified as a name or relative resource name. For example: "projects/{project}/zones/{zone}/machineTypes/{machineType}". Must belong to the enclosing environment's project and region/zone. This field is supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*.`,
134134
},
135135
"network": {
136136
Type: schema.TypeString,
@@ -152,7 +152,7 @@ func resourceComposerEnvironment() *schema.Resource {
152152
Computed: true,
153153
Optional: true,
154154
ForceNew: true,
155-
Description: `The disk size in GB used for node VMs. Minimum size is 20GB. If unspecified, defaults to 100GB. Cannot be updated.`,
155+
Description: `The disk size in GB used for node VMs. Minimum size is 20GB. If unspecified, defaults to 100GB. Cannot be updated. This field is supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*.`,
156156
},
157157
"oauth_scopes": {
158158
Type: schema.TypeSet,
@@ -163,7 +163,7 @@ func resourceComposerEnvironment() *schema.Resource {
163163
Type: schema.TypeString,
164164
},
165165
Set: schema.HashString,
166-
Description: `The set of Google API scopes to be made available on all node VMs. Cannot be updated. If empty, defaults to ["https://www.googleapis.com/auth/cloud-platform"].`,
166+
Description: `The set of Google API scopes to be made available on all node VMs. Cannot be updated. If empty, defaults to ["https://www.googleapis.com/auth/cloud-platform"]. This field is supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*.`,
167167
},
168168
"service_account": {
169169
Type: schema.TypeString,
@@ -182,7 +182,7 @@ func resourceComposerEnvironment() *schema.Resource {
182182
Type: schema.TypeString,
183183
},
184184
Set: schema.HashString,
185-
Description: `The list of instance tags applied to all node VMs. Tags are used to identify valid sources or targets for network firewalls. Each tag within the list must comply with RFC1035. Cannot be updated.`,
185+
Description: `The list of instance tags applied to all node VMs. Tags are used to identify valid sources or targets for network firewalls. Each tag within the list must comply with RFC1035. Cannot be updated. This field is supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*.`,
186186
},
187187
"ip_allocation_policy": {
188188
Type: schema.TypeList,
@@ -198,35 +198,35 @@ func resourceComposerEnvironment() *schema.Resource {
198198
Type: schema.TypeBool,
199199
Required: true,
200200
ForceNew: true,
201-
Description: `Whether or not to enable Alias IPs in the GKE cluster. If true, a VPC-native cluster is created. Defaults to true if the ip_allocation_policy block is present in config.`,
201+
Description: `Whether or not to enable Alias IPs in the GKE cluster. If true, a VPC-native cluster is created. Defaults to true if the ip_allocation_policy block is present in config. This field is only supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*. Environments in newer versions always use VPC-native GKE clusters.`,
202202
},
203203
"cluster_secondary_range_name": {
204204
Type: schema.TypeString,
205205
Optional: true,
206206
ForceNew: true,
207-
Description: `The name of the cluster's secondary range used to allocate IP addresses to pods. Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. This field is applicable only when use_ip_aliases is true.`,
207+
Description: `The name of the cluster's secondary range used to allocate IP addresses to pods. Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both. For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, this field is applicable only when use_ip_aliases is true.`,
208208
ConflictsWith: []string{"config.0.node_config.0.ip_allocation_policy.0.cluster_ipv4_cidr_block"},
209209
},
210210
"services_secondary_range_name": {
211211
Type: schema.TypeString,
212212
Optional: true,
213213
ForceNew: true,
214-
Description: `The name of the services' secondary range used to allocate IP addresses to the cluster. Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. This field is applicable only when use_ip_aliases is true.`,
214+
Description: `The name of the services' secondary range used to allocate IP addresses to the cluster. Specify either services_secondary_range_name or services_ipv4_cidr_block but not both. For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, this field is applicable only when use_ip_aliases is true.`,
215215
ConflictsWith: []string{"config.0.node_config.0.ip_allocation_policy.0.services_ipv4_cidr_block"},
216216
},
217217
"cluster_ipv4_cidr_block": {
218218
Type: schema.TypeString,
219219
Optional: true,
220220
ForceNew: true,
221-
Description: `The IP address range used to allocate IP addresses to pods in the cluster. Set to blank to have GKE choose a range with the default size. Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both.`,
221+
Description: `The IP address range used to allocate IP addresses to pods in the cluster. For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, this field is applicable only when use_ip_aliases is true. Set to blank to have GKE choose a range with the default size. Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. Specify either cluster_secondary_range_name or cluster_ipv4_cidr_block but not both.`,
222222
DiffSuppressFunc: cidrOrSizeDiffSuppress,
223223
ConflictsWith: []string{"config.0.node_config.0.ip_allocation_policy.0.cluster_secondary_range_name"},
224224
},
225225
"services_ipv4_cidr_block": {
226226
Type: schema.TypeString,
227227
Optional: true,
228228
ForceNew: true,
229-
Description: `The IP address range used to allocate IP addresses in this cluster. Set to blank to have GKE choose a range with the default size. Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. Specify either services_secondary_range_name or services_ipv4_cidr_block but not both.`,
229+
Description: `The IP address range used to allocate IP addresses in this cluster. For Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*, this field is applicable only when use_ip_aliases is true. Set to blank to have GKE choose a range with the default size. Set to /netmask (e.g. /14) to have GKE choose a range with a specific netmask. Set to a CIDR notation (e.g. 10.96.0.0/14) from the RFC-1918 private networks (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) to pick a specific range to use. Specify either services_secondary_range_name or services_ipv4_cidr_block but not both.`,
230230
DiffSuppressFunc: cidrOrSizeDiffSuppress,
231231
ConflictsWith: []string{"config.0.node_config.0.ip_allocation_policy.0.services_secondary_range_name"},
232232
},
@@ -283,7 +283,7 @@ func resourceComposerEnvironment() *schema.Resource {
283283
AtLeastOneOf: composerSoftwareConfigKeys,
284284
Computed: true,
285285
ForceNew: true,
286-
Description: `The major version of Python used to run the Apache Airflow scheduler, worker, and webserver processes. Can be set to '2' or '3'. If not specified, the default is '2'. Cannot be updated.`,
286+
Description: `The major version of Python used to run the Apache Airflow scheduler, worker, and webserver processes. Can be set to '2' or '3'. If not specified, the default is '2'. Cannot be updated. This field is supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*. Environments in newer versions always use Python major version 3.`,
287287
},
288288
"scheduler_count": {
289289
Type: schema.TypeInt,
@@ -316,7 +316,7 @@ func resourceComposerEnvironment() *schema.Resource {
316316
"config.0.private_environment_config.0.web_server_ipv4_cidr_block",
317317
},
318318
ForceNew: true,
319-
Description: `If true, access to the public endpoint of the GKE cluster is denied.`,
319+
Description: `If true, access to the public endpoint of the GKE cluster is denied. If this field is set to true, ip_allocation_policy.use_ip_aliases must be set to true for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*.`,
320320
},
321321
"master_ipv4_cidr_block": {
322322
Type: schema.TypeString,
@@ -342,7 +342,7 @@ func resourceComposerEnvironment() *schema.Resource {
342342
"config.0.private_environment_config.0.web_server_ipv4_cidr_block",
343343
},
344344
ForceNew: true,
345-
Description: `The CIDR block from which IP range for web server will be reserved. Needs to be disjoint from master_ipv4_cidr_block and cloud_sql_ipv4_cidr_block.`,
345+
Description: `The CIDR block from which IP range for web server will be reserved. Needs to be disjoint from master_ipv4_cidr_block and cloud_sql_ipv4_cidr_block. This field is supported for Cloud Composer environments in versions composer-1.*.*-airflow-*.*.*.`,
346346
},
347347
"cloud_sql_ipv4_cidr_block": {
348348
Type: schema.TypeString,

0 commit comments

Comments
 (0)