Skip to content

Commit 47884d5

Browse files
authored
feat: adds var.enable_privately_used_public_ips to create_environment_v2 (#129)
1 parent 0a9e47e commit 47884d5

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

modules/create_environment_v2/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module "simple-composer-environment" {
3131
enable_private_endpoint = true
3232
use_private_environment = true
3333
cloud_composer_connection_subnetwork = var.subnetwork_self_link
34+
enable_privately_used_public_ips = var.enable_privately_used_public_ips
3435
3536
scheduler = {
3637
cpu = 0.5
@@ -76,6 +77,7 @@ module "simple-composer-environment" {
7677
| composer\_service\_account | Service Account for running Cloud Composer. | `string` | `null` | no |
7778
| 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 |
7879
| 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 |
80+
| 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 |
7981
| env\_variables | Variables of the airflow environment. | `map(string)` | `{}` | no |
8082
| 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 |
8183
| grant\_sa\_agent\_permission | Cloud Composer relies on Workload Identity as Google API authentication mechanism for Airflow. | `bool` | `true` | no |

modules/create_environment_v2/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ resource "google_composer_environment" "composer_env" {
8686
for_each = var.use_private_environment ? [
8787
{
8888
enable_private_endpoint = var.enable_private_endpoint
89+
enable_privately_used_public_ips = var.enable_privately_used_public_ips
8990
master_ipv4_cidr_block = var.master_ipv4_cidr
9091
cloud_sql_ipv4_cidr_block = var.cloud_sql_ipv4_cidr
9192
cloud_composer_network_ipv4_cidr_block = var.cloud_composer_network_ipv4_cidr_block
9293
cloud_composer_connection_subnetwork = var.cloud_composer_connection_subnetwork
9394
}] : []
9495
content {
9596
enable_private_endpoint = private_environment_config.value["enable_private_endpoint"]
97+
enable_privately_used_public_ips = private_environment_config.value["enable_privately_used_public_ips"]
9698
master_ipv4_cidr_block = private_environment_config.value["master_ipv4_cidr_block"]
9799
cloud_sql_ipv4_cidr_block = private_environment_config.value["cloud_sql_ipv4_cidr_block"]
98100
cloud_composer_network_ipv4_cidr_block = private_environment_config.value["cloud_composer_network_ipv4_cidr_block"]

modules/create_environment_v2/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ variable "enable_private_endpoint" {
142142
default = false
143143
}
144144

145+
variable "enable_privately_used_public_ips" {
146+
description = "When enabled, IPs from public (non-RFC1918) ranges can be used for pod_ip_allocation_range_name and service_ip_allocation_range_name."
147+
type = bool
148+
default = false
149+
}
150+
145151
variable "cloud_composer_network_ipv4_cidr_block" {
146152
description = "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"
147153
type = string

0 commit comments

Comments
 (0)