Commit Graph

27 Commits

Author SHA1 Message Date
The Magician
08c73f2754 Standardize import for instance group manager. (#2946)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-01-28 14:00:05 -08:00
The Magician
2ab6d1995f Add = to map declarations in examples/tests (#2755)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-27 07:51:23 -08:00
The Magician
f26c910f80 Start removing beta igm/rigm fields. (#2393)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-20 17:22:22 -08:00
The Magician
fd6666b3ff Output from magician generating into ga and beta providers (#2271)
<!-- This change is generated by MagicModules. -->
/cc @danawillow
2018-12-20 17:22:22 -08:00
The Magician
bd348c5797 changes to (r)igm so that resources can be converted from beta back to ga (#2260)
<!-- This change is generated by MagicModules. -->
/cc @danawillow
2018-12-20 17:22:22 -08:00
Nathan McKinley
902675c324 Reverting 1.20 and 1.19 cherrypick branches. 2018-12-20 17:22:22 -08:00
The Magician
4a4a33da8a Output from magician generating into ga and beta providers (#2271)
<!-- This change is generated by MagicModules. -->
/cc @danawillow
2018-12-12 17:23:35 -08:00
Paddy Carver
be76ffaa78 Fix whitespace, really.
Tabs v spaces strikes again.
2018-08-21 13:36:04 -07:00
Paddy Carver
dd56795f2a Use family, not name, in image data source. 2018-08-14 11:18:39 -07:00
Paddy Carver
5c9ce55172 Continue our deprecation of debian-8. 2018-08-13 16:20:33 -07:00
Mikaël Gibert
d60381a693 Implement multiple version in instance group manager (#1499)
Hi there,

Here is an attempt to implement canary releases ( #1252 ). This is the first time I write golang and make a terraform contribution, I opened the PR to obtain feedback and advices so please let me know how I can improve this code!

In addition I used `make fmt` to format the code but left some lines bigger than 80 characters, do I need to split them ?

I tested the feature against a project with the following configuration:
```
resource "google_compute_health_check" "mikael-hackathon-healthcheck" {
  name                = "mikael-hackathon-healthcheck"
  check_interval_sec  = 1
  timeout_sec         = 1
  healthy_threshold   = 2
  unhealthy_threshold = 10

  http_health_check {
    request_path = "/"
    port         = "80"
  }
}

resource "google_compute_instance_template" "mikael-hackaton-template" {
  name_prefix = "mikael-hackaton-"
  description = "This template is used to create app server instances."

  tags = ["loadbalanced", "internal-web", "hackaton"]

  labels = {
    environment = "hackaton"
  }

  instance_description = "Hackaton demo rolling upgrade"
  machine_type         = "n1-standard-1"
  can_ip_forward       = false

  scheduling {
    automatic_restart   = true
    on_host_maintenance = "MIGRATE"
  }

  disk {
    source_image = "debian-cloud/debian-9"
    disk_type    = "pd-standard"
    disk_size_gb = 20
    auto_delete  = true
    boot         = true
  }

  network_interface {
    network       = "default"
    access_config = {}
  }

  service_account {
    email  = "${google_service_account.mikael-hackaton.email}"
    scopes = ["cloud-platform"]
  }

  lifecycle {
    create_before_destroy = true
  }

  metadata_startup_script = "apt-get update && apt-get install -y apache2 && echo I am stable version at $(hostname) > /var/www/html/index.html"
}

resource "google_compute_instance_template" "mikael-hackaton-template-canary" {
  name_prefix = "mikael-hackaton-canary"
  description = "This template is used to create app server instances."

  tags = ["loadbalanced", "internal-web", "hackaton"]

  labels = {
    environment = "hackaton"
  }

  instance_description = "Hackaton demo rolling upgrade"
  machine_type         = "n1-standard-1"
  can_ip_forward       = false

  scheduling {
    automatic_restart   = true
    on_host_maintenance = "MIGRATE"
  }

  disk {
    source_image = "debian-cloud/debian-9"
    disk_type    = "pd-standard"
    disk_size_gb = 20
    auto_delete  = true
    boot         = true
  }

  network_interface {
    network       = "default"
    access_config = {}
  }

  service_account {
    email  = "${google_service_account.mikael-hackaton.email}"
    scopes = ["cloud-platform"]
  }

  lifecycle {
    create_before_destroy = true
  }

  metadata_startup_script = "apt-get update && apt-get install -y apache2 && echo I am a canary at $(hostname) > /var/www/html/index.html"
}

resource "google_compute_target_pool" "mikael-hackaton-target-pool" {
  name = "mikael-hackaton-target-pool"
}

resource "google_compute_instance_group_manager" "mikael-hackaton-manager" {
  name = "mikael-hackaton-manager"
  base_instance_name = "mikael-hackaton"
  #instance_template = "${google_compute_instance_template.mikael-hackaton-template.self_link}"
  update_strategy   = "ROLLING_UPDATE"
  zone              = "${var.zone}"
  target_pools = ["${google_compute_target_pool.mikael-hackaton-target-pool.self_link}"]
  target_size  = 5

  version {
    name = "primary"
    instance_template = "${google_compute_instance_template.mikael-hackaton-template.self_link}"
  }

  version {
    name = "canary"
    instance_template = "${google_compute_instance_template.mikael-hackaton-template-canary.self_link}"
    target_size_fixed = 1
  }

  named_port {
    name = "http"
    port = 80
  }

  auto_healing_policies {
    health_check      = "${google_compute_health_check.mikael-hackathon-healthcheck.self_link}"
    initial_delay_sec = 10
  }

  rolling_update_policy {
    type                    = "PROACTIVE"
    minimal_action          = "REPLACE"
    max_surge_percent       = 100
    max_unavailable_percent = 50
    min_ready_sec           = 5
  }
}
```
2018-06-04 15:34:48 -07:00
Dana Hoffman
8907321d60
Roll forward beta scaffolding PR (#1453)
* Revert "Merge pull request #1434 from terraform-providers/paddy_revert_beta"

This reverts commit 118cd71201, reversing
changes made to d59fcbbc59.

* add ConvertSelfLinkToV1 calls to places where beta links are stored
2018-05-09 11:24:40 -07:00
Paddy Carver
aa2626b490 Revert "remove switch statements between api versions for compute"
This reverts commit bf1b3a24e8c1cac832e74d9d0e145c7010a4c2f1.
2018-05-04 07:51:45 -07:00
Dana Hoffman
30409d315e
Remove switch statements between api versions for compute (#1422) 2018-05-03 12:24:21 -07:00
ishashchuk
14f1431896 Rolling update support for instance group manager (#1137) 2018-03-15 11:10:09 -07:00
Vincent Roseberry
d0f5fec463
Standardize resource name extraction from self_link/uri (#939)
* Standardize resource name extraction from self_link/uri

* remove rebase artifact

* style improvement

* Fix merge issue
2018-01-17 10:45:28 -08:00
Vincent Roseberry
52462382c9
Refactor import tests for the remaining compute resources (#909)
* Improve instance group manager import tests

* Improe instance template & project metadata import test

* Improve region autoscaler import test

* Improve router interface import test

* Improve router peer import test

* Improve SSL certs import test

* Improve http & https target proxy import tests

* Improve target pool import test

* Improve url map import test

* Improve target ssl & tcp proxy import test

* Add import test for instance template disk
2018-01-03 09:26:55 -05:00
Joe Selman
4b77dca918 Revert "Revert "Add t.Parallel to all acceptance tests (#558)""
This reverts commit 8ab9d96d25 and revives
the original commit that adds t.Parallel to all acceptance tests. It
turns out test failures were unrelated to this change (rather, they were
related to quota issues).
2017-10-12 15:07:29 -07:00
Joe Selman
8ab9d96d25 Revert "Add t.Parallel to all acceptance tests (#558)"
This reverts commit 42de44592f. It appears
there might be thread-safety issues as panics have started occuring when
parallism is ramped up. Reverting for now while investigating.
2017-10-10 17:55:34 -07:00
Joe Selman
42de44592f Add t.Parallel to all acceptance tests (#558) 2017-10-10 16:28:00 -07:00
Dana Hoffman
bbad89afe6 Fix failing tests: instance templates still use disk (#504)
* instance templates still use the disk field

* more fixes
2017-09-30 19:42:15 -07:00
Paddy
fccae61d61 1.0.0 Deprecations, pt 2
Fix the CI tests we broke with the deprecations for 1.0.0, and update
the docs we missed. Also, update the examples.
2017-09-29 16:04:52 -07:00
Vincent Roseberry
3027822917 Instance group manager cleanup (#409) 2017-09-13 17:06:07 -07:00
Riley Karson
3877b340e6 Add Beta support for auto_healing_policies to instance group manager. (#249)
* Add support for auto_healing_policies to google_compute_instance_group_manager.

* Add a test for self link stability when a v1 resource uses a versioned resource.

* Add a comment about what the stable self link test does.

* make fmt

* Fixed formatting on new tests.

* Address review comments.

* Fix make vet
2017-08-02 10:12:16 -07:00
Riley Karson
3f26ea6425 Updated variable names and docs. 2017-06-16 15:39:44 -07:00
Riley Karson
78b0879c6d Changed google_compute_instance_group_manager target_size default to 0. 2017-06-13 12:43:18 -07:00
Jake Champlin
66029ac431
Transfer google provider 2017-06-06 11:58:51 -04:00