Skip to content

Fix hub and spoke transitivity issues #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

daniel-cit
Copy link
Contributor

@daniel-cit daniel-cit commented Apr 15, 2021

This PR Fixes some issues when enabling hub and spoke transitivity.

  • reproduce error that happens in manual deploy in the integration build.
  • add depends_on in the call to the transitivity module.
  • Fix google_compute_region_instance_group_manager fixed max_surge_fixed for regional managed instance group issue
  • Fix google_compute_region_instance_group_manager fixed max_unavailable_fixed for regional managed instance group issue

Sorry, something went wrong.

@daniel-cit
Copy link
Contributor Author

Error that happens in manual apply of 3-networks shared reproduced in the integration build:

Step #12 - "converge-shared":        module.shared.module.base_transitivity[0].module.ilbs["us-west1"].data.google_compute_subnetwork.network: Refreshing state...
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        Error: Missing required argument
Step #12 - "converge-shared":        
Step #12 - "converge-shared":          on .terraform/modules/shared.base_transitivity.ilbs/main.tf line 124, in resource "google_compute_firewall" "default-hc":
Step #12 - "converge-shared":         124:   network = data.google_compute_network.network.name
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        The argument "network" is required, but no definition was found.
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        Error: Missing required argument
Step #12 - "converge-shared":        
Step #12 - "converge-shared":          on .terraform/modules/shared.base_transitivity.ilbs/main.tf line 124, in resource "google_compute_firewall" "default-hc":
Step #12 - "converge-shared":         124:   network = data.google_compute_network.network.name
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        The argument "network" is required, but no definition was found.
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        Error: Missing required argument
Step #12 - "converge-shared":        
Step #12 - "converge-shared":          on .terraform/modules/shared.restricted_transitivity.ilbs/main.tf line 124, in resource "google_compute_firewall" "default-hc":
Step #12 - "converge-shared":         124:   network = data.google_compute_network.network.name
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        The argument "network" is required, but no definition was found.
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        Error: Missing required argument
Step #12 - "converge-shared":        
Step #12 - "converge-shared":          on .terraform/modules/shared.restricted_transitivity.ilbs/main.tf line 124, in resource "google_compute_firewall" "default-hc":
Step #12 - "converge-shared":         124:   network = data.google_compute_network.network.name
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        The argument "network" is required, but no definition was found.
Step #12 - "converge-shared":        

@daniel-cit
Copy link
Contributor Author

After fixing the dependency error we got:

       
       Error: Error creating RegionInstanceGroupManager: googleapi: Error 400: Invalid value for field 'resource.updatePolicy.maxSurge.fixed': '3'. Fixed updatePolicy.maxSurge for regional managed instance group has to be either 0 or at least equal to the number of zones., invalid
       
         on .terraform/modules/shared.base_transitivity.migs/modules/mig/main.tf line 36, in resource "google_compute_region_instance_group_manager" "mig":
         36: resource "google_compute_region_instance_group_manager" "mig" {
       
       
       
       Error: Error creating RegionInstanceGroupManager: googleapi: Error 400: Invalid value for field 'resource.updatePolicy.maxSurge.fixed': '3'. Fixed updatePolicy.maxSurge for regional managed instance group has to be either 0 or at least equal to the number of zones., invalid
       
         on .terraform/modules/shared.restricted_transitivity.migs/modules/mig/main.tf line 36, in resource "google_compute_region_instance_group_manager" "mig":
         36: resource "google_compute_region_instance_group_manager" "mig" {

This error happens because max_surge_fixed has a fixed value of 3

and one of the regions used, us-central1, has 4 zones to be used as distribution policy zones.

As of 2021-04-15 The fixed value of 3 for the max_surge_fixed will fail for regions europe-west1 and us-central1 which have four zones each.

@daniel-cit
Copy link
Contributor Author

After fixing the max_surge_fixed issue we got the same problem with max_unavailable_fixed:

Step #12 - "converge-shared":        Error: Error creating RegionInstanceGroupManager: googleapi: Error 400: Invalid value for field 'resource.updatePolicy.maxUnavailable.fixed': '3'. Fixed updatePolicy.maxUnavailable for regional managed instance group has to be either 0 or at least equal to the number of zones., invalid
Step #12 - "converge-shared":        
Step #12 - "converge-shared":          on .terraform/modules/shared.base_transitivity.migs/modules/mig/main.tf line 36, in resource "google_compute_region_instance_group_manager" "mig":
Step #12 - "converge-shared":          36: resource "google_compute_region_instance_group_manager" "mig" {
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        
Step #12 - "converge-shared":        Error: Error creating RegionInstanceGroupManager: googleapi: Error 400: Invalid value for field 'resource.updatePolicy.maxUnavailable.fixed': '3'. Fixed updatePolicy.maxUnavailable for regional managed instance group has to be either 0 or at least equal to the number of zones., invalid
Step #12 - "converge-shared":        
Step #12 - "converge-shared":          on .terraform/modules/shared.restricted_transitivity.migs/modules/mig/main.tf line 36, in resource "google_compute_region_instance_group_manager" "mig":
Step #12 - "converge-shared":          36: resource "google_compute_region_instance_group_manager" "mig" {

@daniel-cit daniel-cit changed the title enable hub and spoke transitivity in the integration build Fix hub and spoke transitivity issues Apr 16, 2021
@daniel-cit daniel-cit marked this pull request as ready for review April 16, 2021 13:38
@daniel-cit daniel-cit requested review from bharathkkb, rjerrems and a team as code owners April 16, 2021 13:38
Copy link
Member

@bharathkkb bharathkkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
/cc @drebes

@daniel-cit daniel-cit linked an issue Apr 16, 2021 that may be closed by this pull request
@rjerrems rjerrems merged commit a6b43da into terraform-google-modules:master Apr 19, 2021
@daniel-cit daniel-cit deleted the fix-transitivity-issue branch May 20, 2022 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hub and Spoke mode with transitivity fails to deploy
3 participants