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: add a lien for the seed project #136

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

cagataygurturk
Copy link
Contributor

Fixes #135

@cagataygurturk cagataygurturk changed the title Add a lien for the seed project fix: add a lien for the seed project Nov 21, 2021
@comment-bot-dev
Copy link

comment-bot-dev commented Nov 21, 2021

Thanks for the PR! 🚀
✅ Lint checks have passed.

@cagataygurturk cagataygurturk changed the title fix: add a lien for the seed project feat: add a lien for the seed project Nov 21, 2021
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.

Thanks for the PR @cagataygurturk
This makes sense to me. Let's expose this as a variable so users have control. In the next breaking release we can flip this variable to a default of true. /cc @rjerrems

@morgante
Copy link
Contributor

@bharathkkb I'm not sure we need to make this a variable, since Terraform will handle tearing down the lien properly. It also doesn't need to be a breaking release since AFAIK it won't break anything.

@cagataygurturk
Copy link
Contributor Author

cagataygurturk commented Nov 22, 2021

I have considered making this a variable but I then thought there is not a situation where a user wouldn't want a lien. After all this module is encouraging a secure design based on IaC and a lien makes 100% sure that the very important seed project can't be shut down easily out of IaC.
I am happy to add a variable if you think differently.

@bharathkkb
Copy link
Member

@cagataygurturk makes sense, for some reason I thought TF deleting the lien was a no-op. But @morgante is right, we can keep as is.

@bharathkkb
Copy link
Member

/gcbrun

@bharathkkb bharathkkb merged commit 3853dc4 into terraform-google-modules:master Nov 22, 2021
@cagataygurturk cagataygurturk deleted the patch-2 branch November 22, 2021 20:34
@bdubaut
Copy link

bdubaut commented Feb 13, 2022

Hi! There seems to be a permission that my service account does not have, which makes my pipelines fail as I get the following error message: Error: Error creating Lien: googleapi: Error 403: The caller does not have permission

Error: Error creating Lien: googleapi: Error 403: The caller does not have permission
[172](https://github.com/getjellydog/0_bootstrap/runs/5174524454?check_suite_focus=true#step:9:172)
│ 
[173](https://github.com/getjellydog/0_bootstrap/runs/5174524454?check_suite_focus=true#step:9:173)
│   with module.seed_bootstrap.module.seed_project.module.project-factory.google_resource_manager_lien.lien[0],
[174](https://github.com/getjellydog/0_bootstrap/runs/5174524454?check_suite_focus=true#step:9:174)
│   on .terraform/modules/seed_bootstrap.seed_project/modules/core_project_factory/main.tf line 79, in resource "google_resource_manager_lien" "lien":
[175](https://github.com/getjellydog/0_bootstrap/runs/5174524454?check_suite_focus=true#step:9:175)
│   79: resource "google_resource_manager_lien" "lien" ***

In my main.tf using the bootstrap module, I have the following permissions set:

module "seed_bootstrap" {
  source                         = "terraform-google-modules/bootstrap/google"
  version                        = "5.0.0"

  sa_org_iam_permissions = [
    "roles/accesscontextmanager.policyAdmin",
    "roles/billing.user",
    "roles/compute.networkAdmin",
    "roles/compute.xpnAdmin",
    "roles/compute.xpnAdmin",
    "roles/iam.securityAdmin",
    "roles/iam.serviceAccountAdmin",
    "roles/iam.serviceAccountTokenCreator",
    "roles/logging.configWriter",
    "roles/orgpolicy.policyAdmin",
    "roles/resourcemanager.folderAdmin",
    "roles/resourcemanager.organizationViewer",
    "roles/resourcemanager.projectCreator",
    "roles/securitycenter.notificationConfigEditor",
    "roles/storage.admin",
    "roles/storage.objectAdmin"
  ]

What am I missing ?

@cagataygurturk
Copy link
Contributor Author

@bdubaut please try with roles/resourcemanager.lienModifier

@bdubaut
Copy link

bdubaut commented Feb 20, 2022

@bdubaut please try with roles/resourcemanager.lienModifier

Thanks! I just tried and unfortunately I get the same error:

│ Error: Error creating Lien: googleapi: Error 403: The caller does not have permission
│ 
[246](https://github.com/getjellydog/0_bootstrap/runs/5265805948?check_suite_focus=true#step:9:246)
│   with module.seed_bootstrap.module.seed_project.module.project-factory.google_resource_manager_lien.lien[0],
[247](https://github.com/getjellydog/0_bootstrap/runs/5265805948?check_suite_focus=true#step:9:247)
│   on .terraform/modules/seed_bootstrap.seed_project/modules/core_project_factory/main.tf line 79, in resource "google_resource_manager_lien" "lien":
[248](https://github.com/getjellydog/0_bootstrap/runs/5265805948?check_suite_focus=true#step:9:248)
│   79: resource "google_resource_manager_lien" "lien" ***

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.

Consider adding a lien for the seed project
5 participants