Skip to content

Commit

Permalink
create new gcp network module
Browse files Browse the repository at this point in the history
  • Loading branch information
umeshkumhar committed Mar 28, 2024
1 parent 92245b6 commit 686bd82
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
26 changes: 13 additions & 13 deletions infrastructure/tfvars_tests/standard-gke-public.platform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ cpu_pools = [{
## make sure required gpu quotas are available in the corresponding region
enable_gpu = true
gpu_pools = [{
name = "gpu-pool-l4"
machine_type = "g2-standard-24"
node_locations = "us-central1-a"
autoscaling = true
name = "gpu-pool-l4"
machine_type = "g2-standard-24"
node_locations = "us-central1-a"
autoscaling = true

min_count = 2
max_count = 3
accelerator_count = 2
disk_size_gb = 100
enable_gcfs = true
logging_variant = "DEFAULT"
disk_type = "pd-balanced"
accelerator_type = "nvidia-l4"
gpu_driver_version = "LATEST"
min_count = 2
max_count = 3
accelerator_count = 2
disk_size_gb = 100
enable_gcfs = true
logging_variant = "DEFAULT"
disk_type = "pd-balanced"
accelerator_type = "nvidia-l4"
gpu_driver_version = "LATEST"
}]
12 changes: 6 additions & 6 deletions modules/gcp-network/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

## Create network
resource "google_compute_network" "network" {
project = var.project_id
name = var.network_name
auto_create_subnetworks = var.auto_create_subnetworks
routing_mode = var.routing_mode
description = var.description
project = var.project_id
name = var.network_name
auto_create_subnetworks = var.auto_create_subnetworks
routing_mode = var.routing_mode
description = var.description
}

locals {
Expand Down Expand Up @@ -71,7 +71,7 @@ resource "google_compute_subnetwork" "subnetwork" {
ipv6_access_type = lookup(each.value, "ipv6_access_type", null)

lifecycle {
ignore_changes = [ secondary_ip_range ]
ignore_changes = [secondary_ip_range]
}
}

Expand Down
4 changes: 2 additions & 2 deletions modules/gcp-network/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ output "network_name" {
}

output "subnets_names" {
value = [ for sb in google_compute_subnetwork.subnetwork : sb.name ]
value = [for sb in google_compute_subnetwork.subnetwork : sb.name]
}

output "subnets_ips" {
value = [ for sb in google_compute_subnetwork.subnetwork : sb.ip_cidr_range ]
value = [for sb in google_compute_subnetwork.subnetwork : sb.ip_cidr_range]
}
4 changes: 2 additions & 2 deletions modules/gcp-network/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ variable "secondary_ranges" {
}

variable "create_psa" {
type = bool
description = "Enable PSA for the network"
type = bool
description = "Enable PSA for the network"
}

0 comments on commit 686bd82

Please sign in to comment.