Comments (2)
Running into this as well.
from terraform-google-vm.
Hello.
I plunged into this bug so much that I created a test project (https://github.com/pksmall/terraform-google-lb-http-mig).
@ivankorn described the bug in as much detail as possible and I repeated it on my environment:
...
# module.mig1.google_compute_region_instance_group_manager.mig must be replaced
+/- resource "google_compute_region_instance_group_manager" "mig" {
base_instance_name = "multi-mig-lb-http-group1"
~ distribution_policy_zones = [
- "europe-west3-a",
- "europe-west3-b",
- "europe-west3-c",
] -> (known after apply) # forces replacement
...
~ target_size = 2 -> 0
+ auto_healing_policies {
+ initial_delay_sec = 0
}
...
# module.mig2.google_compute_region_instance_group_manager.mig must be replaced
+/- resource "google_compute_region_instance_group_manager" "mig" {
base_instance_name = "multi-mig-lb-http-group2"
~ distribution_policy_zones = [
- "us-east1-b",
- "us-east1-c",
- "us-east1-d",
] -> (known after apply) # forces replacement
...
+ auto_healing_policies {
+ initial_delay_sec = 0
}
...
Error: Error creating RegionInstanceGroupManager: googleapi: Error 409: The resource 'projects/operating-bolt-254712/regions/us-west1/instanceGroupManagers/multi-mig-lb-http-group3-mig' already exists, alreadyExists
on ../terraform-google-vm/modules/mig/main.tf line 33, in resource "google_compute_region_instance_group_manager" "mig":
33: resource "google_compute_region_instance_group_manager" "mig" {
Changes to the local variable distribution_policy_zones result in a forced replacement and change with every apply.
There was a fix to this bug, I thought, but itβs not. Log with edits from @evkuzin:
# module.mig1.google_compute_region_instance_group_manager.mig must be replaced
+/- resource "google_compute_region_instance_group_manager" "mig" {
base_instance_name = "multi-mig-lb-http-group1"
~ distribution_policy_zones = [
- "europe-west3-a",
- "europe-west3-b",
- "europe-west3-c",
] -> (known after apply) # forces replacement
Error: Error creating RegionInstanceGroupManager: googleapi: Error 409: The resource 'projects/operating-bolt-254712/regions/us-west1/instanceGroupManagers/multi-mig-lb-http-group3-mig' already exists, alreadyExists
on ../terraform-google-vm/modules/mig/main.tf line 33, in resource "google_compute_region_instance_group_manager" "mig":
33: resource "google_compute_region_instance_group_manager" "mig" {
Equally, almost only:
+ auto_healing_policies {
+ initial_delay_sec = 0
}
it has become dynamic.
With my fix log:
..
# module.mig1.google_compute_region_instance_group_manager.mig will be updated in-place
~ resource "google_compute_region_instance_group_manager" "mig" {
base_instance_name = "multi-mig-lb-http-group1"
distribution_policy_zones = [
"europe-west3-a",
"europe-west3-b",
"europe-west3-c",
]
~ target_size = 2 -> 0
...
Apply complete! Resources: 0 added, 3 changed, 0 destroyed.
Outputs:
load-balancer-ip = 34.102.215.73
$ ./test.sh
+ set -e
++ terraform output load-balancer-ip
+ URL=http://34.102.215.73
+ status=0
+ count=0
+ [[ 0 -lt 720 ]]
+ [[ 0 -ne 200 ]]
+ echo 'INFO: Waiting for load balancer...'
INFO: Waiting for load balancer...
++ curl -sf -m 5 -o /dev/null -w '%{http_code}' http://34.102.215.73
+ status=200
+ (( count=count+1 ))
+ sleep 5
+ [[ 1 -lt 720 ]]
+ [[ 200 -ne 200 ]]
+ [[ 1 -lt 720 ]]
+ echo 'INFO: PASS'
INFO: PASS
Bingo. It's worked. And as described in readme we got a response from group#2.
Pull request on the way. Thank you.
p.s. My apologies for the long comment :)
from terraform-google-vm.
Related Issues (20)
- Upgrading from 7.9.0 to 8.0.0 breaks existing google_compute_instance_template
- Error specifying source_image or source_image_family
- Error: project: required field is not set HOT 1
- managed instance group update_policy conflict on required variables HOT 2
- Instance Template creates pd-standard disk instead of pd-balanced HOT 1
- Please expose resource_policies as a variable for the instance_template HOT 2
- Autoscaling signal empty condition HOT 1
- modules/umig creates a group per instance if num_instances>1 HOT 1
- Module for `instance_template` fails `terraform validate` in `v9.0.0` release HOT 2
- Add secure tags (resource_manager_tags) on compute_instance module
- Link to project_services module broken HOT 1
- Add support for enable_display and allow_stopping_for_update to compute_instance HOT 1
- B
- Attaching the existing disk in Instance template HOT 1
- Optional object type attributes are experimental: instance_template/variables.tf line 169 HOT 2
- Property "static_ips" isn't use in compute instance HOT 2
- Usage examples missing HOT 1
- Add Support for the source_image field on additional_disks
- Support resource_manager_tags on instance_template module
- Upgrade of instance_template and compute_instance from v10.1.1 to v11.1.0 triggers replacement of the VM
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-google-vm.