diff --git a/README.md b/README.md index c2d2352..82fee83 100644 --- a/README.md +++ b/README.md @@ -249,7 +249,7 @@ You can check the status of the certificate in the Google Cloud Console. | [iap\_backend\_security\_policy](#input\_iap\_backend\_security\_policy) | Name of the security policy to apply to the IAP backend service | `string` | `null` | no | | [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 | | [labels](#input\_labels) | Key-value pairs representing labels attaching to instance & instance template | `map(any)` | `{}` | no | -| [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 | +| [machine\_image](#input\_machine\_image) | The machine image to create VMs with, if not specified, latest cos\_cloud/cos\_stable is used. To pin to one, use the following format: projects/cos-cloud/global/images/cos-stable-109-17800-147-54 | `string` | `null` | no | | [machine\_type](#input\_machine\_type) | The machine type to run Atlantis on | `string` | `"n2-standard-2"` | no | | [name](#input\_name) | Custom name that's used during resource creation | `string` | n/a | yes | | [network](#input\_network) | Name of the network | `string` | n/a | yes | diff --git a/main.tf b/main.tf index a6201be..5a4ff66 100644 --- a/main.tf +++ b/main.tf @@ -79,8 +79,9 @@ data "cloudinit_config" "config" { } module "container" { - source = "terraform-google-modules/container-vm/google" - version = "~> 3.2" + source = "terraform-google-modules/container-vm/google" + version = "~> 3.2" + cos_image_name = var.machine_image != null ? element(split("/", var.machine_image), length(split("/", var.machine_image)) - 1) : null container = { image = var.image diff --git a/variables.tf b/variables.tf index 5c864d5..7e50163 100644 --- a/variables.tf +++ b/variables.tf @@ -25,7 +25,7 @@ variable "zone" { variable "machine_image" { type = string - description = "The machine image to create VMs with, if not specified, latest cos_cloud/cos_stable is used" + description = "The machine image to create VMs with, if not specified, latest cos_cloud/cos_stable is used. To pin to one, use the following format: projects/cos-cloud/global/images/cos-stable-109-17800-147-54" default = null }