-
Notifications
You must be signed in to change notification settings - Fork 725
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
Terraform service account permissions for resources in created projects #592
Comments
If projects are created using the bootstrap process + examples in this repo, the Terraform account should get owner access already. if you're using some other process to create the projects (it's not entirely clear where your implementation diverged from the example), you should go ahead and grant the Terraform service account editor permission. You can add that to the roles granted in the bootstrap by overriding |
Agreed, haha -- I'm trying to nail down exactly how the To clarify, our bootstrap module is loosely based on the jenkins-agent example from this repo. Instead of uncommenting the
That said, I think I've figured this out. I suspect that what I'm bumping into is similar to this Github issue from the The linked issue above suggests that an resource "google_project_iam_binding" "owner" {
project = module.cicd_project.project_id
role = "roles/owner"
member = "serviceAccount:${module.seed_bootstrap.terraform_sa_email}"
} Then for future steps ( Is this is the case then great, we can close this issue. If you think it would be worth expanding the README documentation in this repo to describe this let me know -- I'd be happy to submit a PR for review. |
Yep, |
The Cloud Security Foundations Guide mentions in section 5.3.6. that
It's not clear to me where (or if) these permissions are configured for the Terraform service account in the
0-bootstrap
module.In my specific case, I've replaced the Cloudbuild/Jenkins project with a custom CI/CD project that creates:
I then successfully deployed this manually to create the seed & CI/CD projects. Now, I'm trying to plan this while impersonating the Terraform service account from the seed project and I'm getting errors refreshing my state:
Just wondering what the recommended approach is here per the CFT guide & this example repo. Should I:
google_*_iam_member
bindings to the Terraform service account for the resources created in all child projects (seems tedious & error-prone)?Or have I simply goofed the manual bootstrapping steps and this should already be working?
The text was updated successfully, but these errors were encountered: