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

add a google_organization_iam_policy resource #1128

Closed
lawrenae opened this issue Feb 26, 2018 · 5 comments · Fixed by #1196
Closed

add a google_organization_iam_policy resource #1128

lawrenae opened this issue Feb 26, 2018 · 5 comments · Fixed by #1196

Comments

@lawrenae
Copy link
Contributor

lawrenae commented Feb 26, 2018

Hi,

I need the ability add multiple roles to a group at the organization level.

Actual

google_organization_iam_binding
google_organization_iam_custom_role
google_organization_iam_member

Expected

google_organization_iam_binding
google_organization_iam_custom_role
google_organization_iam_member
google_organization_iam_policy

I can do this at a project level like so:

resource "google_project_iam_policy" "project" {
  project     = "your-project-id"
  policy_data = "${data.google_iam_policy.admin.policy_data}"
}

data "google_iam_policy" "admin" {
  binding {
    role = "roles/editor"

    members = [
      "user:[email protected]",
    ]
  }
}

(from https://www.terraform.io/docs/providers/google/r/google_project_iam_policy.html)

and so would like the same at the organization level.

Am I missing it somewhere? Thanks in advance!

@danawillow
Copy link
Contributor

The _policy resources are misleading- they intend to be the full authoritative version of the policy, meaning they overwrite any existing policies that were set manually or that came as a default with the project. Is that what you're hoping to get out of an organization policy resource?

In the meantime, you can accomplish what you want via either the _member or _binding resources, by just having multiple resources per group.

/cc @rosbo

@lawrenae
Copy link
Contributor Author

thanks @danawillow -- I do think thats what I want. Essentially my thinking is that "org level" iam config should be overwritten by terraform so as to "reset" any customization of such config outside of terraform -- that is, if it isnt configured in terraform, it didnt happen :)

No doubt, it would be a dangerous thing to use, however

@nat-henderson
Copy link
Contributor

By analogy to #843 / #1190, I think this can probably be done by ignoring defaults and placing big warnings on the docs page. I'll go do that real quick and we can discuss on the PR.

@nat-henderson
Copy link
Contributor

I also want to let you know that we don't have any way to acceptance test this resource - we can't create organizations programmatically and our test org is administered by hand, so running this in a real live test is guaranteed to cause damage. Import is the only thing we can test without destructive effect, and that does work correctly.

modular-magician added a commit to modular-magician/terraform-provider-google that referenced this issue Sep 27, 2019
@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants