Skip to content

Commit 7840e07

Browse files
feat: Support to create v2 private service connection (#50)
Co-authored-by: Bharath KKB <[email protected]>
1 parent d3b2e0f commit 7840e07

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

modules/create_environment_v2/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module "composer" {
1717
| Name | Description | Type | Default | Required |
1818
|------|-------------|------|---------|:--------:|
1919
| 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 |
20+
| cloud\_composer\_connection\_subnetwork | When specified, the environment will use Private Service Connect instead of VPC peerings to connect to Cloud SQL in the Tenant Project | `string` | `null` | no |
2021
| cloud\_composer\_network\_ipv4\_cidr\_block | The CIDR block from which IP range in tenant project will be reserved. | `string` | `null` | no |
2122
| cloud\_sql\_ipv4\_cidr | The CIDR block from which IP range in tenant project will be reserved for Cloud SQL. | `string` | `null` | no |
2223
| composer\_env\_name | Name of Cloud Composer Environment | `string` | n/a | yes |

modules/create_environment_v2/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@ resource "google_composer_environment" "composer_env" {
7474
master_ipv4_cidr_block = var.master_ipv4_cidr
7575
cloud_sql_ipv4_cidr_block = var.cloud_sql_ipv4_cidr
7676
cloud_composer_network_ipv4_cidr_block = var.cloud_composer_network_ipv4_cidr_block
77+
cloud_composer_connection_subnetwork = var.cloud_composer_connection_subnetwork
7778
}] : []
7879
content {
7980
enable_private_endpoint = private_environment_config.value["enable_private_endpoint"]
8081
master_ipv4_cidr_block = private_environment_config.value["master_ipv4_cidr_block"]
8182
cloud_sql_ipv4_cidr_block = private_environment_config.value["cloud_sql_ipv4_cidr_block"]
8283
cloud_composer_network_ipv4_cidr_block = private_environment_config.value["cloud_composer_network_ipv4_cidr_block"]
84+
cloud_composer_connection_subnetwork = private_environment_config.value["cloud_composer_connection_subnetwork"]
8385
}
8486
}
8587

modules/create_environment_v2/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ variable "use_private_environment" {
112112
default = false
113113
}
114114

115+
variable "cloud_composer_connection_subnetwork" {
116+
description = "When specified, the environment will use Private Service Connect instead of VPC peerings to connect to Cloud SQL in the Tenant Project"
117+
type = string
118+
default = null
119+
}
120+
115121
variable "cloud_sql_ipv4_cidr" {
116122
description = "The CIDR block from which IP range in tenant project will be reserved for Cloud SQL."
117123
type = string

0 commit comments

Comments
 (0)