Skip to content

Commit 49829e8

Browse files
authored
feat: Add min_cpu_platform variable support (#161)
1 parent 615c8bc commit 49829e8

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

modules/instance_template/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ See the [simple](../../examples/instance_template/simple) for a usage example.
2424
| labels | Labels, provided as a map | `map(string)` | `{}` | no |
2525
| machine\_type | Machine type to create, e.g. n1-standard-1 | `string` | `"n1-standard-1"` | no |
2626
| metadata | Metadata, provided as a map | `map(string)` | `{}` | no |
27+
| min\_cpu\_platform | Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform | `string` | `null` | no |
2728
| name\_prefix | Name prefix for the instance template | `string` | `"default-instance-template"` | no |
2829
| network | The name or self\_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. | `string` | `""` | no |
2930
| network\_ip | Private IP address to assign to the instance if desired. | `string` | `""` | no |

modules/instance_template/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ resource "google_compute_instance_template" "tpl" {
7171
can_ip_forward = var.can_ip_forward
7272
metadata_startup_script = var.startup_script
7373
region = var.region
74+
min_cpu_platform = var.min_cpu_platform
7475
dynamic "disk" {
7576
for_each = local.all_disks
7677
content {

modules/instance_template/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ variable "machine_type" {
3030
default = "n1-standard-1"
3131
}
3232

33+
variable "min_cpu_platform" {
34+
description = "Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform"
35+
type = string
36+
default = null
37+
}
38+
3339
variable "can_ip_forward" {
3440
description = "Enable IP forwarding, for NAT instances for example"
3541
default = "false"

0 commit comments

Comments
 (0)