Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module for instance_template fails terraform validate in v9.0.0 release #331

Closed
lhriley opened this issue Aug 29, 2023 · 2 comments
Closed
Labels
bug Something isn't working Stale

Comments

@lhriley
Copy link

lhriley commented Aug 29, 2023

TL;DR

Module for instance_template fails terraform validate in v9.0.0 release.

Expected behavior

module passes terraform validate

Observed behavior

❯ terraform validate
╷
│ Error: Unsupported argument
│ 
│   on .terraform/modules/instance_template/modules/instance_template/main.tf line 168, in resource "google_compute_instance_template" "tpl":
│  168:     provisioning_model          = var.spot ? "SPOT" : null
│ 
│ An argument named "provisioning_model" is not expected here.
╵
╷
│ Error: Unsupported argument
│ 
│   on .terraform/modules/instance_template/modules/instance_template/main.tf line 169, in resource "google_compute_instance_template" "tpl":
│  169:     instance_termination_action = var.spot ? "STOP" : null
│ 
│ An argument named "instance_termination_action" is not expected here.

Terraform Configuration

module "instance_template" {
  source = "git::https://github.com/terraform-google-modules/terraform-google-vm.git//modules/instance_template?ref=v9.0.0"

  service_account = {
    email  = module.gcp_service_account.email
    scopes = ["cloud-platform"]
  }
}

Terraform Version

multiple versions:

❯ terraform version
Terraform v1.4.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v3.90.1
+ provider registry.terraform.io/hashicorp/random v3.5.1
+ provider registry.terraform.io/hashicorp/template v2.2.0

Your version of Terraform is out of date! The latest version
is 1.5.6. You can update by downloading from https://www.terraform.io/downloads.html
❯ terraform version
Terraform v1.5.6
on linux_amd64
+ provider registry.terraform.io/hashicorp/google v3.90.1
+ provider registry.terraform.io/hashicorp/random v3.5.1
+ provider registry.terraform.io/hashicorp/template v2.2.0

Additional information

This is not an issue in the v8.0.1 release of the module.

@lhriley lhriley added the bug Something isn't working label Aug 29, 2023
@tpdownes
Copy link
Member

tpdownes commented Sep 7, 2023

I think #330 may resolve your issue. The problem is likely that the minimum version of the google plugin was set too low. I think you have two options:

  • run terraform init -upgrade
  • point your source to a pre-release of 10.0.0 and run terraform init

The 2nd solution would look like:

module "instance_template" {
  source = "git::https://github.com/terraform-google-modules/terraform-google-vm.git//modules/instance_template?ref=f067e54"
  ...

A quick scan of release notes for the provider plugin suggests this needs to read at least 4.30.0 for v9.0.0. #330 bumps that further to 4.67.0.

+ provider registry.terraform.io/hashicorp/google v3.90.1

Copy link

github-actions bot commented Nov 6, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Nov 6, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

2 participants