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

Gcloud provider plugin allows only one resource in provider config resource list. #282

Open
utsav14nov opened this issue Sep 15, 2022 · 3 comments

Comments

@utsav14nov
Copy link
Contributor

utsav14nov commented Sep 15, 2022

Description
Gcloud provider plugin allows only one resource in provider config resource list but there can be 2 possible resource types (project and organization) for gcloud.

To Reproduce
Create/update provider having two resources in resource list Eg:

....
...
  "resources": [
    {
      "type": "project",
      "policy": {
        "id": "policy_id",
        "version": 4
      },
      "roles": [
        {
          "id": "Role Owner",
          "name": "Role Owner",
          "permissions": [
            "roles/owner"
          ]
        }
      ]
    },
    {
      "type": "organization",
      "policy": {
        "id": "policy_id",
        "version": 1
      },
      "roles": [
        {
          "id": "Bigquery Data Viewer",
          "name": "Bigquery Data Viewer",
          "permissions": [
            "roles/bigquery.dataViewer"
          ]
        }
      ]
    }
  ] 

Error

{
    "code": 13,
    "message": "failed to update provider: gcloud_iam should have one resource"
}
@ravisuhag
Copy link
Member

@rahmatrhd @bsushmith IS this related to bulk approval?

@bsushmith
Copy link
Member

bsushmith commented Sep 20, 2022

@ravisuhag
Currently, the gcloud_iam provider lets a user configure either project or organization as a resource. But only one per provider.

Code - https://github.com/odpf/guardian/blob/main/plugins/providers/gcloudiam/config.go#L104

The documentation helps to understand this a bit. But coming from other providers - where one can onboard multiple resource types per provider, the limitation on the gcloud_iam provider is not immediately clear. If the doc can be improved to point this out, that would be great.

cc/ @utsav14nov

@ravisuhag
Copy link
Member

Understood.

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

No branches or pull requests

3 participants