confluentinc / ccloud-tools

Running Tools from Confluent Platform along with your Confluent Cloud™ Cluster
Apache License 2.0
65 stars 31 forks source link

fix for Error: "version": required field is not set #23

Closed vdesabou closed 4 years ago

vdesabou commented 4 years ago

Terraform version used:

$ terraform -v

Terraform v0.12.20
+ provider.google v3.8.0
+ provider.template v2.1.2

Getting error:

Error: "version": required field is not set

  on compute.tf line 49, in resource "google_compute_region_instance_group_manager" "rest_proxy":
  49: resource "google_compute_region_instance_group_manager" "rest_proxy" {

Error: "instance_template": this field cannot be set

  on compute.tf line 49, in resource "google_compute_region_instance_group_manager" "rest_proxy":
  49: resource "google_compute_region_instance_group_manager" "rest_proxy" {

Error: "version": required field is not set

  on compute.tf line 148, in resource "google_compute_region_instance_group_manager" "kafka_connect":
 148: resource "google_compute_region_instance_group_manager" "kafka_connect" {

Error: "instance_template": this field cannot be set

  on compute.tf line 148, in resource "google_compute_region_instance_group_manager" "kafka_connect":
 148: resource "google_compute_region_instance_group_manager" "kafka_connect" {

Error: "version": required field is not set

  on compute.tf line 247, in resource "google_compute_region_instance_group_manager" "ksql_server":
 247: resource "google_compute_region_instance_group_manager" "ksql_server" {

Error: "instance_template": this field cannot be set

  on compute.tf line 247, in resource "google_compute_region_instance_group_manager" "ksql_server":
 247: resource "google_compute_region_instance_group_manager" "ksql_server" {

Error: "version": required field is not set

  on compute.tf line 346, in resource "google_compute_region_instance_group_manager" "control_center":
 346: resource "google_compute_region_instance_group_manager" "control_center" {

Error: "instance_template": this field cannot be set

  on compute.tf line 346, in resource "google_compute_region_instance_group_manager" "control_center":
 346: resource "google_compute_region_instance_group_manager" "control_center" {

version is now mandatory in google_compute_region_instance_group_manager

vdesabou commented 4 years ago

Even with that fix, I get during terraform apply:

Error: could not parse "ip_address" to IP address

  on compute.tf line 11, in resource "google_compute_global_forwarding_rule" "rest_proxy":
  11: resource "google_compute_global_forwarding_rule" "rest_proxy" {

Error: could not parse "ip_address" to IP address

  on compute.tf line 113, in resource "google_compute_global_forwarding_rule" "kafka_connect":
 113: resource "google_compute_global_forwarding_rule" "kafka_connect" {

Error: could not parse "ip_address" to IP address

  on compute.tf line 215, in resource "google_compute_global_forwarding_rule" "ksql_server":
 215: resource "google_compute_global_forwarding_rule" "ksql_server" {

Error: could not parse "ip_address" to IP address

  on compute.tf line 317, in resource "google_compute_global_forwarding_rule" "control_center":
 317: resource "google_compute_global_forwarding_rule" "control_center" {

I think it's because I'm using provider.google v3.x and this repo was done using v2.x, so we would need to apply all those upgrades https://www.terraform.io/docs/providers/google/guides/version_3_upgrade.html

Maybe an easier solution would be to force provider google to 2.x version in main.yml ?

provider "google" {
  credentials = file(var.gcp_credentials)
  project     = var.gcp_project
  region      = local.region
  version = "~> 2.20.2"
}