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

terraform: allow GCP console access without opening debugd port #3357

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module "gcp_infrastructure" {
}
image_id = data.constellation_image.bar.image.reference
debug = false
console_access = false
zone = local.zone
region = local.region
project = local.project_id
Expand Down
1 change: 1 addition & 0 deletions terraform/infrastructure/gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ module "instance_group" {
alias_ip_range_name = google_compute_subnetwork.vpc_subnetwork.secondary_ip_range[0].range_name
kube_env = local.kube_env
debug = var.debug
console_access = var.console_access
named_ports = each.value.role == "control-plane" ? local.control_plane_named_ports : []
labels = local.labels
init_secret_hash = local.init_secret_hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ resource "google_compute_instance_template" "template" {
metadata = {
kube-env = var.kube_env
constellation-init-secret-hash = var.init_secret_hash
serial-port-enable = var.debug ? "TRUE" : "FALSE"
serial-port-enable = (var.debug || var.console_access) ? "TRUE" : "FALSE"
}

network_interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ variable "debug" {
description = "DO NOT USE IN PRODUCTION. Enable debug mode. This opens up a debugd port that can be used to deploy a custom bootstrapper."
}

variable "console_access" {
type = bool
description = "Enable serial console access to OS images that expose a serial console. This will be shadowed by `debug` (i.e. if `debug` is enabled, console access will be enabled)."
}

variable "alias_ip_range_name" {
type = string
description = "Name of the alias IP range to use."
Expand Down
6 changes: 6 additions & 0 deletions terraform/infrastructure/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ variable "debug" {
description = "DO NOT USE IN PRODUCTION. Enable debug mode. This opens up a debugd port that can be used to deploy a custom bootstrapper."
}

variable "console_access" {
type = bool
default = false
description = "Enable serial console access to OS images that expose a serial console. This will be shadowed by `debug` (i.e. if `debug` is enabled, console access will be enabled)."
}

variable "custom_endpoint" {
type = string
default = ""
Expand Down