Skip to content

Commit

Permalink
Merge pull request #329 from CloudVLab/tlf_labproxy
Browse files Browse the repository at this point in the history
LA Proxy - add mandatory parameters
  • Loading branch information
rosera committed Jul 28, 2023
2 parents 92f65ca + 94a8904 commit 9db6e6b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
13 changes: 8 additions & 5 deletions solutions/lab_proxy/dev/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ resource "google_vpc_access_connector" "connector" {
provider = google-beta
name = "ideconn"
region = var.gcp_region
network = var.vpcNetworkName
network = var.vpcNetworkName
ip_cidr_range = "10.8.0.0/28"

min_throughput = 200
max_throughput = 300

# Note: valid options: f1-micro, e2-micro, e2-standard-4
machine_type = var.vpcConnectorMachineType

depends_on = [ google_project_service.vpcaccess-api ]
depends_on = [google_project_service.vpcaccess-api]
}


Expand All @@ -46,15 +49,15 @@ resource "google_project_service" "run" {


resource "google_cloud_run_service" "ide" {
name = var.gcrServiceName
name = var.gcrServiceName
# location = var.gcrRegion
location = var.gcp_region

template {
spec {
containers {
# image = "gcr.io/qwiklabs-resources/ide-proxy:latest"
image = var.gcrContainerImage
image = var.gcrContainerImage
}
container_concurrency = 2
}
Expand All @@ -76,7 +79,7 @@ resource "google_cloud_run_service" "ide" {
}

# Dependency - Cloud Run API enabled
depends_on = [google_project_service.run, google_vpc_access_connector.connector ]
depends_on = [google_project_service.run, google_vpc_access_connector.connector]
}


Expand Down
2 changes: 1 addition & 1 deletion solutions/lab_proxy/dev/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
## --------------------------------------------------------------

output "ideEditorService" {
value = "${google_cloud_run_service.ide.status[0].url}"
value = google_cloud_run_service.ide.status[0].url
description = "URL of the IDE service"
}
4 changes: 2 additions & 2 deletions solutions/lab_proxy/dev/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ variable "vpcSubnetName" {

# Custom properties with defaults
variable "vpcConnectorMachineType" {
type = string
type = string
description = "VPC Access Connector Machine Type"
# Note: valid options: f1-micro, e2-micro, e2-standard-4
default = "e2-micro"
default = "e2-micro"
}

variable "gcrServiceName" {
Expand Down

0 comments on commit 9db6e6b

Please sign in to comment.