Skip to content
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

Bugfix/fix 4-projects issues #374

Conversation

renato-rudnicki
Copy link
Contributor

@renato-rudnicki renato-rudnicki commented Mar 12, 2021

This PR contains the fix for the following issues:

  • 350 - common.auto.tfvars link pointing to an example file
  • 351 - Missing backend.tf file from shared folder
  • 352 - access_context_manager_policy_id but a value was found in file "common.auto.tfvars"
  • 353 - billingbudgets.googleapis.com is not enabled for infra-cicd deployment
  • 365 - MIssing app_infra_pipeline_cloudbuild_sa variable on environments tfvars examples in step 4-projects

@bharathkkb
Copy link
Member

/gcbrun

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.

@renato-rudnicki
Copy link
Contributor Author

Increasing lifetime field in providers.tf from 900s to 1200s due timeout during build tests.

@bharathkkb
Copy link
Member

/gcbrun

provider = google.impersonate
target_service_account = local.tf_sa
scopes = ["userinfo-email", "cloud-platform"]
lifetime = "600s"
Copy link
Member

Choose a reason for hiding this comment

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

Let's keep this uniform here and throughout

Suggested change
lifetime = "600s"
lifetime = "1200s"

@renato-rudnicki
Copy link
Contributor Author

Updating lifetime to 1200ms in shared/providers.tf in Business Unit 1 and 2.

data "google_service_account_access_token" "default" {
  provider               = google.impersonate
  target_service_account = local.tf_sa
  scopes                 = ["userinfo-email", "cloud-platform"]
  lifetime               = "1200s"
}

@daniel-cit
Copy link
Contributor

build 4b01ba07-eef9-4fc3-a2d0-bc5409b92aef for the default mode failed in this test:

Profile: tests from /workspace/test/integration/projects (tests from .workspace.test.integration.projects)
Version: (not specified)
Target:  local://
  ×  gcloud-projects: gcloud step 4-projects tests (1 failed)
     ×  Command: `gcloud access-context-manager perimeters describe sp_d_shared_restricted_default_perimeter_3dbe --policy <REDACTED> --format=json` Access Context Manager perimeter sp_d_shared_restricted_default_perimeter_3dbe should include tst-bu1-d-sample-restrict-dbd2 project
     expected ["projects/136738339700", "projects/759250792841"] to include "projects/580269401305"

checking the previous steps, the reason for project 580269401305 not being in the perimeter was a concurrente update of the service perimeter by the two dev projects, bu1 and bu2.

it is necessary to add an explicitly dependency between the modules in the fixture for step 4-projects
https://github.com/terraform-google-modules/terraform-example-foundation/blob/develop/test/fixtures/projects/main.tf

so that the bu2 projects wait for their pair in bu1 to run before updating the service perimeter.

This error does not happens in the cloud build deploy because the shell script serializes the execution of the two projects for the same environment.

@bharathkkb
Copy link
Member

@daniel-cit Thanks for investigating, I do see the converge worked fine Creation complete after 1s [id=accessPolicies/x/servicePerimeters/sp_d_shared_restricted_default_perimeter_3dbe/projects/580269401305]

For serializing you may have to do something like 85dec25

Copy link
Contributor

@daniel-cit daniel-cit left a comment

Choose a reason for hiding this comment

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

LGTM

@bharathkkb bharathkkb merged commit 32c94af into terraform-google-modules:develop Mar 19, 2021
bharathkkb pushed a commit that referenced this pull request Mar 30, 2021
* Fix issue 350 - common.auto.tfvars link pointing to an example file

* Fix issue 351 - Missing backend.tf file and provider.tf from shared folder

* Adding versions.tf

* Adding versions.tf for BU 1 and 2

* Fixing access_context

* Adding extra steps for Business Unit 1 and 2

* Updating Readme.md and adding business_unit example files

* Adding simbolic links for business_unit 1 and 2

* Increasing providers.tf from 900s to 1200s

* Updating lifetime to 1200ms in shared/providers.tf
bharathkkb pushed a commit that referenced this pull request Mar 30, 2021
* Fix issue 350 - common.auto.tfvars link pointing to an example file

* Fix issue 351 - Missing backend.tf file and provider.tf from shared folder

* Adding versions.tf

* Adding versions.tf for BU 1 and 2

* Fixing access_context

* Adding extra steps for Business Unit 1 and 2

* Updating Readme.md and adding business_unit example files

* Adding simbolic links for business_unit 1 and 2

* Increasing providers.tf from 900s to 1200s

* Updating lifetime to 1200ms in shared/providers.tf
bharathkkb pushed a commit that referenced this pull request Mar 30, 2021
* Fix issue 350 - common.auto.tfvars link pointing to an example file

* Fix issue 351 - Missing backend.tf file and provider.tf from shared folder

* Adding versions.tf

* Adding versions.tf for BU 1 and 2

* Fixing access_context

* Adding extra steps for Business Unit 1 and 2

* Updating Readme.md and adding business_unit example files

* Adding simbolic links for business_unit 1 and 2

* Increasing providers.tf from 900s to 1200s

* Updating lifetime to 1200ms in shared/providers.tf
bharathkkb pushed a commit that referenced this pull request Mar 31, 2021
* Fix issue 350 - common.auto.tfvars link pointing to an example file

* Fix issue 351 - Missing backend.tf file and provider.tf from shared folder

* Adding versions.tf

* Adding versions.tf for BU 1 and 2

* Fixing access_context

* Adding extra steps for Business Unit 1 and 2

* Updating Readme.md and adding business_unit example files

* Adding simbolic links for business_unit 1 and 2

* Increasing providers.tf from 900s to 1200s

* Updating lifetime to 1200ms in shared/providers.tf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants