Closed ziporah closed 5 years ago
The tests will fail, because the current test image is using terraform v0.11 I could not find a v0.12 image (yet) The latest image available was : this one
Issue also exists with terraform v0.12.0. I did some local tests to build a new gcr.io/cloud-foundation-cicd/cft/kitchen-terraform image which uses the latest terraform and google 2.7.0 providers
-BUILD_TERRAFORM_VERSION := 0.11.13
+BUILD_TERRAFORM_VERSION := 0.12.0
BUILD_CLOUD_SDK_VERSION := 239.0.0
-BUILD_PROVIDER_GOOGLE_VERSION := 1.19.1
+BUILD_PROVIDER_GOOGLE_VERSION := 2.7.0
=> forcing the kitchen.yaml to ignore the terraform version
@@ -16,6 +16,7 @@
driver:
name: "terraform"
command_timeout: 1800
+ verify_version: false
Allows me to generate a valid configuration and test for the single instance. I believe more changes are required to make the other tests work. (test output)[https://gist.github.com/ziporah/b927628247ded05e76d07b383a7a0db0]
Hi @ziporah!
If I understand correctly, the initial crash which you shared was resolved by using a supported version of the Google provider, but there is still a need to change this module in order to support Terraform v0.12. Is that correct? Additionally, is #26 the fix for this issue?
I believe you will need all the commits in my master branch for the tests to work, we will need a new terraform-kitchen image and Makefile adjustments to use that image before the tests will work. I'm using my master branch to deploy on our environment now, and that works. Furthermore this syntax:
source = "github.com/terraform-google-modules/terraform-google-container-vm"
version = "0.1.0"
isn't allowed anymore. When you want to use a specific version, you will need to use the official repository of terraform with this syntax, which is not yet in my master branch:
source = "google-terraform-modules/terraform-google-container-vm/google"
version = "0.1.0"
Also getting this:
Error: Invalid argument name
on .terraform/modules/gce-container/terraform-google-modules-terraform-google-container-vm-c968dee/main.tf line 38, in resource "null_resource" "validate_restart_policy":
38: "ERROR: Invalid `restart_policy` ${var.restart_policy} was provided. Must be one of `OnFailure`, `UnlessStopped`, `Always`, or `No`" = true
Argument names must not be quoted.
yes, you also need to transform the code to fix this. this is the relevant commit to fix it: commit after which you'll stumble in the next error, basicaly everything in my master branch has to be added, but since the test framework is not yet upgraded, I can't validate the code yet
@ziporah thanks, waiting for release then
@ziporah a draft of cft/kitchen-terraform:2.0.0 is available which includes Terraform v0.12 and Kitchen-Terraform v4.9.0. Please test your work with that image.
I believe the current version of the module is incompatible with terraform v0.12-rc1
after succesfully applying a configuration with terraform v0.11 run
And then init terraform again: