From 7303a054e5c0368cdd4e66764ed4f672dbbba832 Mon Sep 17 00:00:00 2001 From: Djabx Date: Fri, 9 Apr 2021 18:46:09 +0200 Subject: [PATCH] feat: add preemptible option. (#83) --- README.md | 1 + main.tf | 1 + variables.tf | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 6466b2af..79629b96 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,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 | +| 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 | | scopes | List of scopes to attach to the bastion host | `list(string)` |
[
"cloud-platform"
]
| no | diff --git a/main.tf b/main.tf index eb035f67..089e7c67 100644 --- a/main.tf +++ b/main.tf @@ -62,6 +62,7 @@ module "instance_template" { source_image_family = var.image_family source_image_project = var.image_project startup_script = var.startup_script + preemptible = var.preemptible tags = var.tags labels = var.labels diff --git a/variables.tf b/variables.tf index 6b0e0da4..62f8c17f 100644 --- a/variables.tf +++ b/variables.tf @@ -210,6 +210,12 @@ variable "ephemeral_ip" { default = false } +variable "preemptible" { + type = bool + description = "Allow the instance to be preempted" + default = false +} + variable "access_config" { description = "Access configs for network, nat_ip and DNS" type = list(object({