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

feat: create subfolders for business units in 4-projects step #1039

Conversation

romanini-ciandt
Copy link
Member

@romanini-ciandt romanini-ciandt commented Nov 28, 2023

The goal of this PR is to introduce GCP subfolders per business unit (1 & 2) for all fldr-{env} folders in 4-projects step.
In addition to the folder structure, a minor change at the BU's project name was introduced. See the example below:

Current:

  • fldr-common
    • prj-c-bu1-infra-pipeline
  • fldr-{env}
    • prj-bu1-{env}-foo
    • prj-bu1-{env}-bar
    • prj-bu2-{env}-foo
    • prj-bu2-{env}-bar

Suggested: (including folder structure change + fixes to naming convention)

  • fldr-common
    • prj-c-bu1-infra-pipeline
  • fldr-{env}
    • fldr-{env}-bu1
      • prj-{env}-bu1foo
      • prj-{env}-bu1bar
    • fldr-{env}-bu2
      • prj-{env}-bu2foo
      • prj-{env}-bu2bar

Evidence:
image

@romanini-ciandt romanini-ciandt self-assigned this Nov 28, 2023
@romanini-ciandt romanini-ciandt requested review from rjerrems, gtsorbo and a team as code owners November 28, 2023 20:39
@romanini-ciandt romanini-ciandt marked this pull request as draft November 28, 2023 20:44
@@ -82,8 +82,7 @@ locals {
"roles/dns.admin",
],
"proj" = [
"roles/resourcemanager.folderViewer",
"roles/resourcemanager.folderIamAdmin",
"roles/resourcemanager.folderAdmin",
Copy link
Member Author

Choose a reason for hiding this comment

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

This permission is needed because now 4-projects step creates the proper subfolders by example BUs (before all the folders were created at 2-environments).
folderAdmin because we need permissions to create and destroy.

@romanini-ciandt romanini-ciandt marked this pull request as ready for review November 28, 2023 21:52
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like a hyphen got dropped in the change between business_code and project_suffix "${var.project_prefix}-${local.env_code}-${var.business_code}${var.project_suffix}"

Copy link
Member Author

Choose a reason for hiding this comment

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

@eeaton in order to achieve the requested example we have at the backlog (from prj-bu1-{env}-foo to prj-{env}-bu1foo) I intentionally dropped the hyphen here.

Let me know if sounds good for you or if I misunderstood the request.
Thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the clarification, I thought the variable project_suffix expanded to the 4 digit random id, but if it expands to "prj-{env}-bu1foo-1234" that is correct how you wrote it.

Copy link
Contributor

@gtsorbo gtsorbo left a comment

Choose a reason for hiding this comment

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

ignore my previous comment - LGTM

@daniel-cit
Copy link
Contributor

/gcbrun

@daniel-cit
Copy link
Contributor

@gtsorbo @apeabody build is green :)

@daniel-cit
Copy link
Contributor

We have successful integration builds for this one @gtsorbo @apeabody

@apeabody apeabody merged commit 06084be into terraform-google-modules:master Dec 14, 2023
5 checks passed
@eeaton eeaton mentioned this pull request Mar 7, 2024
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.

5 participants