Skip to content

Commit

Permalink
feat: Support setting a static ip for the bastion
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusramberg committed Jun 12, 2024
1 parent f5b934e commit ec301c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ If the user does not share the same domain as the org the bastion is in, you wil
| name | Name of the Bastion instance | `string` | `"bastion-vm"` | no |
| name\_prefix | Name prefix for instance template | `string` | `"bastion-instance-template"` | no |
| network | Self link for the network on which the Bastion should live | `string` | n/a | yes |
| network\_ip | Private IP address for the bastion host | `string` | `""` | no |
| preemptible | Allow the instance to be preempted | `bool` | `false` | no |
| project | The project ID to deploy to | `string` | n/a | yes |
| random\_role\_id | Enables role random id generation. | `bool` | `true` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ resource "google_compute_instance_from_template" "bastion_vm" {
subnetwork = var.subnet
subnetwork_project = var.host_project != "" ? var.host_project : var.project
access_config = var.external_ip ? var.access_config : []
network_ip = var.network_ip
}

source_instance_template = module.instance_template.self_link
Expand Down
7 changes: 6 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ variable "network" {
description = "Self link for the network on which the Bastion should live"
}

variable "network_ip" {
type = string
description = "Private IP address for the bastion host"
default = ""
}

variable "project" {
type = string

Expand Down Expand Up @@ -281,4 +287,3 @@ variable "can_ip_forward" {
description = "Whether the bastion should allow IP forwarding."
default = false
}

0 comments on commit ec301c1

Please sign in to comment.