Skip to content

Commit b09be98

Browse files
feat: Support setting a static ip for the bastion (#197)
1 parent 8f27f7a commit b09be98

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ If the user does not share the same domain as the org the bastion is in, you wil
9191
| name | Name of the Bastion instance | `string` | `"bastion-vm"` | no |
9292
| name\_prefix | Name prefix for instance template | `string` | `"bastion-instance-template"` | no |
9393
| network | Self link for the network on which the Bastion should live | `string` | n/a | yes |
94+
| network\_ip | Private IP address for the bastion host | `string` | `""` | no |
9495
| preemptible | Allow the instance to be preempted | `bool` | `false` | no |
9596
| project | The project ID to deploy to | `string` | n/a | yes |
9697
| random\_role\_id | Enables role random id generation. | `bool` | `true` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ resource "google_compute_instance_from_template" "bastion_vm" {
9191
subnetwork = var.subnet
9292
subnetwork_project = var.host_project != "" ? var.host_project : var.project
9393
access_config = var.external_ip ? var.access_config : []
94+
network_ip = var.network_ip
9495
}
9596

9697
source_instance_template = module.instance_template.self_link

variables.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ variable "network" {
8888
description = "Self link for the network on which the Bastion should live"
8989
}
9090

91+
variable "network_ip" {
92+
type = string
93+
description = "Private IP address for the bastion host"
94+
default = ""
95+
}
96+
9197
variable "project" {
9298
type = string
9399

@@ -281,4 +287,3 @@ variable "can_ip_forward" {
281287
description = "Whether the bastion should allow IP forwarding."
282288
default = false
283289
}
284-

0 commit comments

Comments
 (0)