Skip to content

Commit

Permalink
minimum set of updates to make this compatible with the second versio…
Browse files Browse the repository at this point in the history
…n of the provider
  • Loading branch information
dcaba committed Feb 25, 2019
1 parent fd61bad commit 340409c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
20 changes: 12 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ resource "google_compute_instance_template" "default" {
network = "${var.subnetwork == "" ? var.network : ""}"
subnetwork = "${var.subnetwork}"
access_config = ["${var.access_config}"]
address = "${var.network_ip}"
network_ip = "${var.network_ip}"
subnetwork_project = "${var.subnetwork_project == "" ? var.project : var.subnetwork_project}"
}

Expand Down Expand Up @@ -67,7 +67,12 @@ resource "google_compute_instance_template" "default" {
}
}

provider "google-beta" {
version = ">= 2.0.0"
}

resource "google_compute_instance_group_manager" "default" {
provider = "google-beta"
count = "${var.module_enabled && var.zonal ? 1 : 0}"
project = "${var.project}"
name = "${var.name}"
Expand All @@ -76,13 +81,14 @@ resource "google_compute_instance_group_manager" "default" {

base_instance_name = "${var.name}"

instance_template = "${google_compute_instance_template.default.self_link}"
version {
name = "${var.name}-default"
instance_template = "${google_compute_instance_template.default.self_link}"
}

zone = "${var.zone}"

update_strategy = "${var.update_strategy}"

rolling_update_policy = ["${var.rolling_update_policy}"]
update_policy = "${var.update_policy}"

target_pools = ["${var.target_pools}"]

Expand Down Expand Up @@ -155,9 +161,7 @@ resource "google_compute_region_instance_group_manager" "default" {

region = "${var.region}"

update_strategy = "${var.update_strategy}"

rolling_update_policy = ["${var.rolling_update_policy}"]
update_policy = "${var.update_policy}"

distribution_policy_zones = ["${local.distribution_zones["${length(var.distribution_policy_zones) == 0 ? "default" : "user"}"]}"]

Expand Down
9 changes: 2 additions & 7 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,8 @@ variable wait_for_instances {
default = false
}

variable update_strategy {
description = "The strategy to apply when the instance template changes."
default = "NONE"
}

variable rolling_update_policy {
description = "The rolling update policy when update_strategy is ROLLING_UPDATE"
variable update_policy {
description = "The upgrade policy to apply when the instance template changes."
type = "list"
default = []
}
Expand Down

0 comments on commit 340409c

Please sign in to comment.