Skip to content

Commit

Permalink
Add external IP to instance template
Browse files Browse the repository at this point in the history
Previously, instances, created by the instance template, were unable to
download the launcher binary, because they had no external IP addresses
assigned.

This PR sets the network tier to `PREMIUM`, which assigns an ephemeral
IP address to the created instances automatically.
  • Loading branch information
rail committed Jun 5, 2024
1 parent e08160a commit d4ae6a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ resource "google_compute_instance_template" "spacelift-worker" {
network_interface {
network = var.network
subnetwork = var.subnetwork
access_config {
network_tier = "PREMIUM"
}
}

service_account {
Expand All @@ -112,7 +115,7 @@ resource "google_compute_instance_template" "spacelift-worker" {
}

resource "google_compute_instance_group_manager" "spacelift-worker" {
name = var.instance_group_manager_name
name = var.instance_group_manager_name

base_instance_name = var.instance_group_base_instance_name
zone = var.zone
Expand Down

0 comments on commit d4ae6a8

Please sign in to comment.