streamline gke module peering project id
This commit is contained in:
parent
a3962dcaf7
commit
2e644a3333
|
@ -58,7 +58,7 @@ module "cluster-1" {
|
|||
| *min_master_version* | Minimum version of the master, defaults to the version of the most recent official release. | <code title="">string</code> | | <code title="">null</code> |
|
||||
| *monitoring_service* | Monitoring service (disable with an empty string). | <code title="">string</code> | | <code title="">monitoring.googleapis.com/kubernetes</code> |
|
||||
| *node_locations* | Zones in which the cluster's nodes are located. | <code title="list(string)">list(string)</code> | | <code title="">[]</code> |
|
||||
| *peering_config* | Configure peering with the master VPC for private clusters. | <code title="object({ export_routes = bool import_routes = bool project_id = string })">object({...})</code> | | <code title="">null</code> |
|
||||
| *peering_config* | Configure peering with the master VPC for private clusters. | <code title="object({ export_routes = bool import_routes = bool project_id = string })">object({...})</code> | | <code title="">null</code> |
|
||||
| *pod_security_policy* | Enable the PodSecurityPolicy feature. | <code title="">bool</code> | | <code title="">null</code> |
|
||||
| *private_cluster_config* | Enable and configure private cluster, private nodes must be true if used. | <code title="object({ enable_private_nodes = bool enable_private_endpoint = bool master_ipv4_cidr_block = string })">object({...})</code> | | <code title="">null</code> |
|
||||
| *release_channel* | Release channel for GKE upgrades. | <code title="">string</code> | | <code title="">null</code> |
|
||||
|
|
|
@ -22,7 +22,11 @@ locals {
|
|||
google_container_cluster.cluster.private_cluster_config.0.peering_name,
|
||||
null
|
||||
)
|
||||
peering_project_id = try(var.peering_config.project_id, "") == "" ? var.project_id : (var.peering_config.project_id == "" ? var.project_id : var.peering_config.project_id)
|
||||
peering_project_id = (
|
||||
try(var.peering_config.project_id, null) == null
|
||||
? var.project_id
|
||||
: var.peering_config.project_id
|
||||
)
|
||||
}
|
||||
|
||||
resource "google_container_cluster" "cluster" {
|
||||
|
|
Loading…
Reference in New Issue