1
0
Fork 0
mirror of https://github.com/imjasonh/terraform-playground synced 2026-07-16 12:42:57 +00:00

Require digest-based image reference and explicit service account

Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-11-28 04:47:36 +00:00
parent ae9b8ff3da
commit 35ddd89c8b
2 changed files with 12 additions and 2 deletions

View file

@ -16,8 +16,13 @@ variable "machine_type" {
}
variable "container_image" {
description = "The container image to run (e.g., 'nginx:latest' or 'gcr.io/my-project/my-app:v1')."
description = "The container image to run, must be referenced by digest (e.g., 'gcr.io/my-project/my-app@sha256:abc123...')."
type = string
validation {
condition = can(regex("^.+@sha256:[a-f0-9]{64}$", var.container_image))
error_message = "The container_image must be referenced by digest (e.g., 'gcr.io/my-project/my-app@sha256:<64 hex chars>')."
}
}
variable "container_name" {
@ -50,6 +55,11 @@ variable "container_args" {
default = []
}
variable "service_account_email" {
description = "The email of the service account to use for the VM. Must be created outside this module."
type = string
}
# Defaulting to COS, which has Docker/containerd pre-installed.
variable "source_image_family" {
description = "The OS image family to use. COS is recommended."