Skip to content

Commit

Permalink
feat: Support to create v2 private service connection (#50)
Browse files Browse the repository at this point in the history
Co-authored-by: Bharath KKB <[email protected]>
  • Loading branch information
lokeshyadavv and bharathkkb authored Jun 24, 2022
1 parent d3b2e0f commit 7840e07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/create_environment_v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module "composer" {
| 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 |
| 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 |
| cloud\_composer\_network\_ipv4\_cidr\_block | The CIDR block from which IP range in tenant project will be reserved. | `string` | `null` | no |
| cloud\_sql\_ipv4\_cidr | The CIDR block from which IP range in tenant project will be reserved for Cloud SQL. | `string` | `null` | no |
| composer\_env\_name | Name of Cloud Composer Environment | `string` | n/a | yes |
Expand Down
2 changes: 2 additions & 0 deletions modules/create_environment_v2/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ resource "google_composer_environment" "composer_env" {
master_ipv4_cidr_block = var.master_ipv4_cidr
cloud_sql_ipv4_cidr_block = var.cloud_sql_ipv4_cidr
cloud_composer_network_ipv4_cidr_block = var.cloud_composer_network_ipv4_cidr_block
cloud_composer_connection_subnetwork = var.cloud_composer_connection_subnetwork
}] : []
content {
enable_private_endpoint = private_environment_config.value["enable_private_endpoint"]
master_ipv4_cidr_block = private_environment_config.value["master_ipv4_cidr_block"]
cloud_sql_ipv4_cidr_block = private_environment_config.value["cloud_sql_ipv4_cidr_block"]
cloud_composer_network_ipv4_cidr_block = private_environment_config.value["cloud_composer_network_ipv4_cidr_block"]
cloud_composer_connection_subnetwork = private_environment_config.value["cloud_composer_connection_subnetwork"]
}
}

Expand Down
6 changes: 6 additions & 0 deletions modules/create_environment_v2/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ variable "use_private_environment" {
default = false
}

variable "cloud_composer_connection_subnetwork" {
description = "When specified, the environment will use Private Service Connect instead of VPC peerings to connect to Cloud SQL in the Tenant Project"
type = string
default = null
}

variable "cloud_sql_ipv4_cidr" {
description = "The CIDR block from which IP range in tenant project will be reserved for Cloud SQL."
type = string
Expand Down

0 comments on commit 7840e07

Please sign in to comment.