diff --git a/CHANGELOG.md b/CHANGELOG.md index 19c9eb2295..bf99d183cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - - [[#774](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/774)] FAST: fix data-platform-dev folder in stage 03-data-platform ([sttomm](https://github.com/sttomm)) -### FAST +### FAST - [[#770](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/770)] FAST: fix to move without `output_location` ([daisuky-jp](https://github.com/daisuky-jp)) - [[#767](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/767)] Allow interpolating SAs in project factory subnet IAM bindings ([ludoo](https://github.com/ludoo)) @@ -56,6 +55,7 @@ All notable changes to this project will be documented in this file. ### MODULES +- [[#778]](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/778) **incompatible change** Add support for instance_termination_action to `compute-vm` - [[#727](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/727)] Fix `ip_range` variable description in `apigee-x-instance` module ([alexlo03](https://github.com/alexlo03)) - [[#773](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/773)] **incompatible change:** Refactor Cloud Run module ([ludoo](https://github.com/ludoo)) - [[#754](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/754)] Add support to a public access to cloudsql-instance ([alefmreis](https://github.com/alefmreis)) @@ -94,7 +94,6 @@ All notable changes to this project will be documented in this file. - [[#680](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/680)] Tools: fix `ValueError` raised in `check_names.py` when overlong names are detected ([27Bslash6](https://github.com/27Bslash6)) - [[#672](https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/pull/672)] Module attribution and version updater tool, plus release automation ([rosmo](https://github.com/rosmo)) - ## [16.0.0] - 2022-06-06 - add support for [Spot VMs](https://cloud.google.com/compute/docs/instances/spot) to `gke-nodepool` module @@ -586,7 +585,6 @@ All notable changes to this project will be documented in this file. - merge development branch with suite of new modules and end-to-end examples - [Unreleased]: https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/compare/v16.0.0...HEAD [16.0.0]: https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/compare/v15.0.0...v16.0.0 @@ -651,4 +649,4 @@ All notable changes to this project will be documented in this file. [1.3.0]: https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/compare/v1.2.0...v1.3.0 [1.2.0]: https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/compare/v1.1.0...v1.2.0 [1.1.0]: https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/compare/v1.0.0...v1.1.0 -[1.0.0]: https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/compare/v0.1...v1.0.0 \ No newline at end of file +[1.0.0]: https://github.com/GoogleCloudPlatform/cloud-foundation-fabric/compare/v0.1...v1.0.0 diff --git a/default-versions.tf b/default-versions.tf index d271fb72d2..4278054b12 100644 --- a/default-versions.tf +++ b/default-versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/cloud-operations/adfs/versions.tf b/examples/cloud-operations/adfs/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/cloud-operations/adfs/versions.tf +++ b/examples/cloud-operations/adfs/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/cloud-operations/asset-inventory-feed-remediation/versions.tf b/examples/cloud-operations/asset-inventory-feed-remediation/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/cloud-operations/asset-inventory-feed-remediation/versions.tf +++ b/examples/cloud-operations/asset-inventory-feed-remediation/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/cloud-operations/dns-fine-grained-iam/versions.tf b/examples/cloud-operations/dns-fine-grained-iam/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/cloud-operations/dns-fine-grained-iam/versions.tf +++ b/examples/cloud-operations/dns-fine-grained-iam/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/cloud-operations/dns-shared-vpc/versions.tf b/examples/cloud-operations/dns-shared-vpc/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/cloud-operations/dns-shared-vpc/versions.tf +++ b/examples/cloud-operations/dns-shared-vpc/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/cloud-operations/iam-delegated-role-grants/versions.tf b/examples/cloud-operations/iam-delegated-role-grants/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/cloud-operations/iam-delegated-role-grants/versions.tf +++ b/examples/cloud-operations/iam-delegated-role-grants/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/cloud-operations/onprem-sa-key-management/versions.tf b/examples/cloud-operations/onprem-sa-key-management/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/cloud-operations/onprem-sa-key-management/versions.tf +++ b/examples/cloud-operations/onprem-sa-key-management/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/cloud-operations/packer-image-builder/versions.tf b/examples/cloud-operations/packer-image-builder/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/cloud-operations/packer-image-builder/versions.tf +++ b/examples/cloud-operations/packer-image-builder/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/cloud-operations/quota-monitoring/versions.tf b/examples/cloud-operations/quota-monitoring/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/cloud-operations/quota-monitoring/versions.tf +++ b/examples/cloud-operations/quota-monitoring/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/cloud-operations/scheduled-asset-inventory-export-bq/versions.tf b/examples/cloud-operations/scheduled-asset-inventory-export-bq/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/cloud-operations/scheduled-asset-inventory-export-bq/versions.tf +++ b/examples/cloud-operations/scheduled-asset-inventory-export-bq/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/data-solutions/cmek-via-centralized-kms/versions.tf b/examples/data-solutions/cmek-via-centralized-kms/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/data-solutions/cmek-via-centralized-kms/versions.tf +++ b/examples/data-solutions/cmek-via-centralized-kms/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/data-solutions/data-playground/versions.tf b/examples/data-solutions/data-playground/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/data-solutions/data-playground/versions.tf +++ b/examples/data-solutions/data-playground/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/data-solutions/gcs-to-bq-with-least-privileges/versions.tf b/examples/data-solutions/gcs-to-bq-with-least-privileges/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/data-solutions/gcs-to-bq-with-least-privileges/versions.tf +++ b/examples/data-solutions/gcs-to-bq-with-least-privileges/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/factories/net-vpc-firewall-yaml/versions.tf b/examples/factories/net-vpc-firewall-yaml/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/factories/net-vpc-firewall-yaml/versions.tf +++ b/examples/factories/net-vpc-firewall-yaml/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/foundations/business-units/versions.tf b/examples/foundations/business-units/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/foundations/business-units/versions.tf +++ b/examples/foundations/business-units/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/foundations/environments/versions.tf b/examples/foundations/environments/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/foundations/environments/versions.tf +++ b/examples/foundations/environments/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/networking/decentralized-firewall/versions.tf b/examples/networking/decentralized-firewall/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/networking/decentralized-firewall/versions.tf +++ b/examples/networking/decentralized-firewall/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/networking/filtering-proxy/versions.tf b/examples/networking/filtering-proxy/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/networking/filtering-proxy/versions.tf +++ b/examples/networking/filtering-proxy/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/networking/hub-and-spoke-peering/versions.tf b/examples/networking/hub-and-spoke-peering/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/networking/hub-and-spoke-peering/versions.tf +++ b/examples/networking/hub-and-spoke-peering/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/networking/hub-and-spoke-vpn/versions.tf b/examples/networking/hub-and-spoke-vpn/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/networking/hub-and-spoke-vpn/versions.tf +++ b/examples/networking/hub-and-spoke-vpn/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/networking/ilb-next-hop/versions.tf b/examples/networking/ilb-next-hop/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/networking/ilb-next-hop/versions.tf +++ b/examples/networking/ilb-next-hop/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/networking/onprem-google-access-dns/versions.tf b/examples/networking/onprem-google-access-dns/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/networking/onprem-google-access-dns/versions.tf +++ b/examples/networking/onprem-google-access-dns/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/networking/private-cloud-function-from-onprem/versions.tf b/examples/networking/private-cloud-function-from-onprem/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/networking/private-cloud-function-from-onprem/versions.tf +++ b/examples/networking/private-cloud-function-from-onprem/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/networking/shared-vpc-gke/versions.tf b/examples/networking/shared-vpc-gke/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/networking/shared-vpc-gke/versions.tf +++ b/examples/networking/shared-vpc-gke/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/examples/third-party-solutions/openshift/tf/versions.tf b/examples/third-party-solutions/openshift/tf/versions.tf index d271fb72d2..4278054b12 100644 --- a/examples/third-party-solutions/openshift/tf/versions.tf +++ b/examples/third-party-solutions/openshift/tf/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/fast/stages/00-cicd/versions.tf b/fast/stages/00-cicd/versions.tf index d271fb72d2..4278054b12 100644 --- a/fast/stages/00-cicd/versions.tf +++ b/fast/stages/00-cicd/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/fast/stages/02-networking-nva/nva.tf b/fast/stages/02-networking-nva/nva.tf index ed882a2527..26d2de1857 100644 --- a/fast/stages/02-networking-nva/nva.tf +++ b/fast/stages/02-networking-nva/nva.tf @@ -59,6 +59,7 @@ module "nva-template-ew1" { allow_stopping_for_update = true deletion_protection = false spot = true + termination_action = "STOP" } metadata = { startup-script = templatefile( diff --git a/fast/stages/02-networking-nva/test-resources.tf b/fast/stages/02-networking-nva/test-resources.tf index e7801dfe1e..f36f22b580 100644 --- a/fast/stages/02-networking-nva/test-resources.tf +++ b/fast/stages/02-networking-nva/test-resources.tf @@ -41,6 +41,7 @@ # allow_stopping_for_update = true # deletion_protection = false # spot = true +# termination_action = "STOP" # } # metadata = { # startup-script = <string | ✓ | | | [network_interfaces](variables.tf#L174) | Network interfaces configuration. Use self links for Shared VPC, set addresses to null if not needed. | list(object({…})) | ✓ | | -| [project_id](variables.tf#L201) | Project id. | string | ✓ | | -| [zone](variables.tf#L260) | Compute zone. | string | ✓ | | +| [project_id](variables.tf#L209) | Project id. | string | ✓ | | +| [zone](variables.tf#L268) | Compute zone. | string | ✓ | | | [attached_disk_defaults](variables.tf#L17) | Defaults for attached disks options. | object({…}) | | {…} | | [attached_disks](variables.tf#L32) | Additional disks, if options is null defaults will be used in its place. Source type is one of 'image' (zonal disks in vms and template), 'snapshot' (vm), 'existing', and null. | list(object({…})) | | [] | | [boot_disk](variables.tf#L58) | Boot disk properties. | object({…}) | | {…} | @@ -347,14 +348,14 @@ module "instance-group" { | [metadata](variables.tf#L148) | Instance metadata. | map(string) | | {} | | [min_cpu_platform](variables.tf#L154) | Minimum CPU platform. | string | | null | | [network_interface_options](variables.tf#L165) | Network interfaces extended options. The key is the index of the inteface to configure. The value is an object with alias_ips and nic_type. Set alias_ips or nic_type to null if you need only one of them. | map(object({…})) | | {} | -| [options](variables.tf#L187) | Instance options. | object({…}) | | {…} | -| [scratch_disks](variables.tf#L206) | Scratch disks configuration. | object({…}) | | {…} | -| [service_account](variables.tf#L218) | Service account email. Unused if service account is auto-created. | string | | null | -| [service_account_create](variables.tf#L224) | Auto-create service account. | bool | | false | -| [service_account_scopes](variables.tf#L232) | Scopes applied to service account. | list(string) | | [] | -| [shielded_config](variables.tf#L238) | Shielded VM configuration of the instances. | object({…}) | | null | -| [tag_bindings](variables.tf#L248) | Tag bindings for this instance, in key => tag value id format. | map(string) | | null | -| [tags](variables.tf#L254) | Instance network tags for firewall rule targets. | list(string) | | [] | +| [options](variables.tf#L187) | Instance options. | object({…}) | | {…} | +| [scratch_disks](variables.tf#L214) | Scratch disks configuration. | object({…}) | | {…} | +| [service_account](variables.tf#L226) | Service account email. Unused if service account is auto-created. | string | | null | +| [service_account_create](variables.tf#L232) | Auto-create service account. | bool | | false | +| [service_account_scopes](variables.tf#L240) | Scopes applied to service account. | list(string) | | [] | +| [shielded_config](variables.tf#L246) | Shielded VM configuration of the instances. | object({…}) | | null | +| [tag_bindings](variables.tf#L256) | Tag bindings for this instance, in key => tag value id format. | map(string) | | null | +| [tags](variables.tf#L262) | Instance network tags for firewall rule targets. | list(string) | | [] | ## Outputs diff --git a/modules/compute-vm/main.tf b/modules/compute-vm/main.tf index a8f2bb4574..8cbd42151c 100644 --- a/modules/compute-vm/main.tf +++ b/modules/compute-vm/main.tf @@ -29,6 +29,12 @@ locals { for k, v in local.attached_disks : k => v if try(v.options.replica_zone, null) == null } + network_interface_options = { + for i, v in var.network_interfaces : i => lookup(var.network_interface_options, i, { + alias_ips = null, + nic_type = null + }) + } on_host_maintenance = ( var.options.spot || var.confidential_compute ? "TERMINATE" @@ -60,13 +66,7 @@ locals { ] ) ) - - network_interface_options = { - for i, v in var.network_interfaces : i => lookup(var.network_interface_options, i, { - alias_ips = null, - nic_type = null - }) - } + termination_action = var.options.spot ? coalesce(var.options.termination_action, "STOP") : null } resource "google_compute_disk" "disks" { @@ -212,10 +212,11 @@ resource "google_compute_instance" "default" { } scheduling { - automatic_restart = !var.options.spot - on_host_maintenance = local.on_host_maintenance - preemptible = var.options.spot - provisioning_model = var.options.spot ? "SPOT" : "STANDARD" + automatic_restart = !var.options.spot + instance_termination_action = local.termination_action + on_host_maintenance = local.on_host_maintenance + preemptible = var.options.spot + provisioning_model = var.options.spot ? "SPOT" : "STANDARD" } dynamic "scratch_disk" { @@ -339,10 +340,11 @@ resource "google_compute_instance_template" "default" { } scheduling { - automatic_restart = !var.options.spot - on_host_maintenance = local.on_host_maintenance - preemptible = var.options.spot - provisioning_model = var.options.spot ? "SPOT" : "STANDARD" + automatic_restart = !var.options.spot + instance_termination_action = local.termination_action + on_host_maintenance = local.on_host_maintenance + preemptible = var.options.spot + provisioning_model = var.options.spot ? "SPOT" : "STANDARD" } service_account { diff --git a/modules/compute-vm/variables.tf b/modules/compute-vm/variables.tf index a44e3bf72d..867194082d 100644 --- a/modules/compute-vm/variables.tf +++ b/modules/compute-vm/variables.tf @@ -190,11 +190,19 @@ variable "options" { allow_stopping_for_update = bool deletion_protection = bool spot = bool + termination_action = string }) default = { allow_stopping_for_update = true deletion_protection = false spot = false + termination_action = null + } + validation { + condition = (var.options.termination_action == null + || + contains(["STOP", "DELETE"], coalesce(var.options.termination_action, "1"))) + error_message = "Allowed values for options.termination_action are 'STOP', 'DELETE' and null." } } diff --git a/modules/compute-vm/versions.tf b/modules/compute-vm/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/compute-vm/versions.tf +++ b/modules/compute-vm/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/container-registry/versions.tf b/modules/container-registry/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/container-registry/versions.tf +++ b/modules/container-registry/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/data-catalog-policy-tag/versions.tf b/modules/data-catalog-policy-tag/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/data-catalog-policy-tag/versions.tf +++ b/modules/data-catalog-policy-tag/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/datafusion/versions.tf b/modules/datafusion/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/datafusion/versions.tf +++ b/modules/datafusion/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/dns/versions.tf b/modules/dns/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/dns/versions.tf +++ b/modules/dns/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/endpoints/versions.tf b/modules/endpoints/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/endpoints/versions.tf +++ b/modules/endpoints/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/folder/versions.tf b/modules/folder/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/folder/versions.tf +++ b/modules/folder/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/folders-unit/versions.tf b/modules/folders-unit/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/folders-unit/versions.tf +++ b/modules/folders-unit/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/gcs/versions.tf b/modules/gcs/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/gcs/versions.tf +++ b/modules/gcs/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/gke-cluster/versions.tf b/modules/gke-cluster/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/gke-cluster/versions.tf +++ b/modules/gke-cluster/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/gke-hub/versions.tf b/modules/gke-hub/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/gke-hub/versions.tf +++ b/modules/gke-hub/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/gke-nodepool/versions.tf b/modules/gke-nodepool/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/gke-nodepool/versions.tf +++ b/modules/gke-nodepool/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/iam-service-account/versions.tf b/modules/iam-service-account/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/iam-service-account/versions.tf +++ b/modules/iam-service-account/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/kms/versions.tf b/modules/kms/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/kms/versions.tf +++ b/modules/kms/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/logging-bucket/versions.tf b/modules/logging-bucket/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/logging-bucket/versions.tf +++ b/modules/logging-bucket/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/naming-convention/versions.tf b/modules/naming-convention/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/naming-convention/versions.tf +++ b/modules/naming-convention/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-address/versions.tf b/modules/net-address/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-address/versions.tf +++ b/modules/net-address/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-cloudnat/versions.tf b/modules/net-cloudnat/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-cloudnat/versions.tf +++ b/modules/net-cloudnat/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-glb/versions.tf b/modules/net-glb/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-glb/versions.tf +++ b/modules/net-glb/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-ilb-l7/versions.tf b/modules/net-ilb-l7/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-ilb-l7/versions.tf +++ b/modules/net-ilb-l7/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-ilb/versions.tf b/modules/net-ilb/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-ilb/versions.tf +++ b/modules/net-ilb/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-interconnect-attachment-direct/versions.tf b/modules/net-interconnect-attachment-direct/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-interconnect-attachment-direct/versions.tf +++ b/modules/net-interconnect-attachment-direct/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-vpc-firewall/versions.tf b/modules/net-vpc-firewall/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-vpc-firewall/versions.tf +++ b/modules/net-vpc-firewall/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-vpc-peering/versions.tf b/modules/net-vpc-peering/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-vpc-peering/versions.tf +++ b/modules/net-vpc-peering/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-vpc/versions.tf b/modules/net-vpc/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-vpc/versions.tf +++ b/modules/net-vpc/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-vpn-dynamic/versions.tf b/modules/net-vpn-dynamic/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-vpn-dynamic/versions.tf +++ b/modules/net-vpn-dynamic/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-vpn-ha/versions.tf b/modules/net-vpn-ha/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-vpn-ha/versions.tf +++ b/modules/net-vpn-ha/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/net-vpn-static/versions.tf b/modules/net-vpn-static/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/net-vpn-static/versions.tf +++ b/modules/net-vpn-static/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/organization-policy/versions.tf b/modules/organization-policy/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/organization-policy/versions.tf +++ b/modules/organization-policy/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/organization/versions.tf b/modules/organization/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/organization/versions.tf +++ b/modules/organization/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/project/versions.tf b/modules/project/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/project/versions.tf +++ b/modules/project/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/projects-data-source/versions.tf b/modules/projects-data-source/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/projects-data-source/versions.tf +++ b/modules/projects-data-source/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/pubsub/versions.tf b/modules/pubsub/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/pubsub/versions.tf +++ b/modules/pubsub/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/secret-manager/versions.tf b/modules/secret-manager/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/secret-manager/versions.tf +++ b/modules/secret-manager/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/service-directory/versions.tf b/modules/service-directory/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/service-directory/versions.tf +++ b/modules/service-directory/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/source-repository/versions.tf b/modules/source-repository/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/source-repository/versions.tf +++ b/modules/source-repository/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } } diff --git a/modules/vpc-sc/versions.tf b/modules/vpc-sc/versions.tf index d271fb72d2..4278054b12 100644 --- a/modules/vpc-sc/versions.tf +++ b/modules/vpc-sc/versions.tf @@ -17,11 +17,11 @@ terraform { required_providers { google = { source = "hashicorp/google" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.25.0" # tftest + version = ">= 4.32.0" # tftest } } }