Skip to content

Commit

Permalink
Merge pull request #112 from dennislapchenko/pin_machine_image
Browse files Browse the repository at this point in the history
Allow pinning vm's machine image, instead of always using latest …stable/cos_cloud
  • Loading branch information
bschaatsbergen authored Mar 25, 2023
2 parents a2e5b05 + 6f498d7 commit d89899e
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 @@ -221,6 +221,7 @@ You can check the status of the certificate in the Google Cloud Console.
| <a name="input_iap"></a> [iap](#input\_iap) | Settings for enabling Cloud Identity Aware Proxy to protect the Atlantis UI | <pre>object({<br> oauth2_client_id = string<br> oauth2_client_secret = string<br> })</pre> | `null` | no |
| <a name="input_image"></a> [image](#input\_image) | Docker image. This is most often a reference to a container located in a container registry | `string` | `"ghcr.io/runatlantis/atlantis:latest"` | no |
| <a name="input_labels"></a> [labels](#input\_labels) | Key-value pairs representing labels attaching to instance & instance template | `map(any)` | `{}` | no |
| <a name="input_machine_image"></a> [machine\_image](#input\_machine\_image) | The machine image to create VMs with, if not specified, latest cos\_cloud/cos\_stable is used | `string` | `null` | no |
| <a name="input_machine_type"></a> [machine\_type](#input\_machine\_type) | The machine type to run Atlantis on | `string` | `"n2-standard-2"` | no |
| <a name="input_name"></a> [name](#input\_name) | Custom name that's used during resource creation | `string` | n/a | yes |
| <a name="input_network"></a> [network](#input\_network) | Name of the network | `string` | n/a | yes |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ resource "google_compute_instance_template" "default" {

# Ephemeral OS boot disk
disk {
source_image = data.google_compute_image.cos.self_link
source_image = var.machine_image != null ? var.machine_image : data.google_compute_image.cos.self_link
auto_delete = true
boot = true
disk_type = "pd-ssd"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ variable "zone" {
description = "The zone that instances should be created in"
}

variable "machine_image" {
type = string
description = "The machine image to create VMs with, if not specified, latest cos_cloud/cos_stable is used"
default = null
}

variable "machine_type" {
type = string
description = "The machine type to run Atlantis on"
Expand Down

0 comments on commit d89899e

Please sign in to comment.