Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add peering_name output for private cluster modules #484

Merged
merged 1 commit into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion autogen/main/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ locals {
cluster_output_zones = local.cluster_output_regional_zones

{% if private_cluster %}
cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_peering_name = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? google_container_cluster.primary.private_cluster_config.0.peering_name : null
{% else %}
cluster_endpoint = google_container_cluster.primary.endpoint
{% endif %}
Expand Down
4 changes: 4 additions & 0 deletions autogen/main/outputs.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ output "master_ipv4_cidr_block" {
value = var.master_ipv4_cidr_block
}

output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = local.cluster_peering_name
}
{% endif %}
{% if beta_cluster %}

Expand Down
5 changes: 5 additions & 0 deletions autogen/safer-cluster/outputs.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@ output "master_ipv4_cidr_block" {
description = "The IP range in CIDR notation used for the hosted master network"
value = var.master_ipv4_cidr_block
}

output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = module.gke.peering_name
}
2 changes: 1 addition & 1 deletion examples/deploy_service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/disable_client_cert/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
5 changes: 4 additions & 1 deletion examples/private_zonal_with_networking/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ output "subnet_secondary_ranges" {
value = module.gcp-network.subnets_secondary_ranges
}


output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = module.gke.peering_name
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

provider "google" {
version = "3.3.0"
version = "3.14.0"
}

provider "google-beta" {
version = "3.3.0"
version = "3.14.0"
}
2 changes: 1 addition & 1 deletion examples/shared_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_regional/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_regional_private/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_regional_with_networking/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
}

module "gcp-network" {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_zonal_private/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_zonal_with_acm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/stub_domains/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/stub_domains_private/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/stub_domains_upstream_nameservers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
2 changes: 1 addition & 1 deletion examples/upstream_nameservers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ locals {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
region = var.region
}

Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ Then perform the following commands on the root folder:
| network\_policy\_enabled | Whether network policy enabled |
| node\_pools\_names | List of node pools names |
| node\_pools\_versions | List of node pools versions |
| peering\_name | The name of the peering between this cluster and the Google owned VPC. |
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
| region | Cluster region |
| release\_channel | The release channel of this cluster |
Expand Down
3 changes: 2 additions & 1 deletion modules/beta-private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ locals {
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones

cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_peering_name = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? google_container_cluster.primary.private_cluster_config.0.peering_name : null

cluster_output_master_auth = concat(google_container_cluster.primary.*.master_auth, [])
cluster_output_master_version = google_container_cluster.primary.master_version
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ output "master_ipv4_cidr_block" {
value = var.master_ipv4_cidr_block
}

output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = local.cluster_peering_name
}

output "istio_enabled" {
description = "Whether Istio is enabled"
Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ Then perform the following commands on the root folder:
| network\_policy\_enabled | Whether network policy enabled |
| node\_pools\_names | List of node pools names |
| node\_pools\_versions | List of node pools versions |
| peering\_name | The name of the peering between this cluster and the Google owned VPC. |
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
| region | Cluster region |
| release\_channel | The release channel of this cluster |
Expand Down
3 changes: 2 additions & 1 deletion modules/beta-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ locals {
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones

cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_peering_name = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? google_container_cluster.primary.private_cluster_config.0.peering_name : null

cluster_output_master_auth = concat(google_container_cluster.primary.*.master_auth, [])
cluster_output_master_version = google_container_cluster.primary.master_version
Expand Down
4 changes: 4 additions & 0 deletions modules/beta-private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ output "master_ipv4_cidr_block" {
value = var.master_ipv4_cidr_block
}

output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = local.cluster_peering_name
}

output "istio_enabled" {
description = "Whether Istio is enabled"
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ Then perform the following commands on the root folder:
| network\_policy\_enabled | Whether network policy enabled |
| node\_pools\_names | List of node pools names |
| node\_pools\_versions | List of node pools versions |
| peering\_name | The name of the peering between this cluster and the Google owned VPC. |
| region | Cluster region |
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
| type | Cluster type (regional / zonal) |
Expand Down
3 changes: 2 additions & 1 deletion modules/private-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ locals {
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones

cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_peering_name = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? google_container_cluster.primary.private_cluster_config.0.peering_name : null

cluster_output_master_auth = concat(google_container_cluster.primary.*.master_auth, [])
cluster_output_master_version = google_container_cluster.primary.master_version
Expand Down
4 changes: 4 additions & 0 deletions modules/private-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,7 @@ output "master_ipv4_cidr_block" {
value = var.master_ipv4_cidr_block
}

output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = local.cluster_peering_name
}
1 change: 1 addition & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Then perform the following commands on the root folder:
| network\_policy\_enabled | Whether network policy enabled |
| node\_pools\_names | List of node pools names |
| node\_pools\_versions | List of node pools versions |
| peering\_name | The name of the peering between this cluster and the Google owned VPC. |
| region | Cluster region |
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
| type | Cluster type (regional / zonal) |
Expand Down
3 changes: 2 additions & 1 deletion modules/private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ locals {
cluster_output_zonal_zones = local.zone_count > 1 ? slice(var.zones, 1, local.zone_count) : []
cluster_output_zones = local.cluster_output_regional_zones

cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_endpoint = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? (var.deploy_using_private_endpoint ? google_container_cluster.primary.private_cluster_config.0.private_endpoint : google_container_cluster.primary.private_cluster_config.0.public_endpoint) : google_container_cluster.primary.endpoint
cluster_peering_name = (var.enable_private_nodes && length(google_container_cluster.primary.private_cluster_config) > 0) ? google_container_cluster.primary.private_cluster_config.0.peering_name : null

cluster_output_master_auth = concat(google_container_cluster.primary.*.master_auth, [])
cluster_output_master_version = google_container_cluster.primary.master_version
Expand Down
4 changes: 4 additions & 0 deletions modules/private-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,7 @@ output "master_ipv4_cidr_block" {
value = var.master_ipv4_cidr_block
}

output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = local.cluster_peering_name
}
1 change: 1 addition & 0 deletions modules/safer-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ For simplicity, we suggest using `roles/container.admin` and
| network\_policy\_enabled | Whether network policy enabled |
| node\_pools\_names | List of node pools names |
| node\_pools\_versions | List of node pools versions |
| peering\_name | The name of the peering between this cluster and the Google owned VPC. |
| region | Cluster region |
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
| type | Cluster type (regional / zonal) |
Expand Down
5 changes: 5 additions & 0 deletions modules/safer-cluster-update-variant/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@ output "master_ipv4_cidr_block" {
description = "The IP range in CIDR notation used for the hosted master network"
value = var.master_ipv4_cidr_block
}

output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = module.gke.peering_name
}
1 change: 1 addition & 0 deletions modules/safer-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ For simplicity, we suggest using `roles/container.admin` and
| network\_policy\_enabled | Whether network policy enabled |
| node\_pools\_names | List of node pools names |
| node\_pools\_versions | List of node pools versions |
| peering\_name | The name of the peering between this cluster and the Google owned VPC. |
| region | Cluster region |
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
| type | Cluster type (regional / zonal) |
Expand Down
5 changes: 5 additions & 0 deletions modules/safer-cluster/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@ output "master_ipv4_cidr_block" {
description = "The IP range in CIDR notation used for the hosted master network"
value = var.master_ipv4_cidr_block
}

output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = module.gke.peering_name
}
2 changes: 1 addition & 1 deletion test/fixtures/deploy_service/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "random_string" "suffix" {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
project = var.project_ids[0]
}

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/disable_client_cert/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "random_string" "suffix" {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
project = var.project_ids[0]
}

Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/private_zonal_with_networking/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,7 @@ output "ip_range_services_name" {
description = "The secondary range name for services"
value = module.example.ip_range_services_name
}
output "peering_name" {
description = "The name of the peering between this cluster and the Google owned VPC."
value = module.example.peering_name
}
2 changes: 1 addition & 1 deletion test/fixtures/shared_vpc/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "random_string" "suffix" {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
project = var.project_ids[0]
}

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/simple_regional/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "random_string" "suffix" {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
project = var.project_ids[0]
}

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/simple_zonal/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "random_string" "suffix" {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
project = var.project_ids[1]
}

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/stub_domains/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "random_string" "suffix" {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
project = var.project_ids[1]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "random_string" "suffix" {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
project = var.project_ids[1]
}

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/upstream_nameservers/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "random_string" "suffix" {
}

provider "google" {
version = "~> 3.3.0"
version = "~> 3.14.0"
project = var.project_ids[1]
}

Expand Down
Loading