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

Data source for IAM Testable Permissions #6382

Conversation

modular-magician
Copy link
Collaborator

Release Note Template for Downstream PRs (will be copied)

Add google_iam_testable_permissions data source

Fixes: #6120
Fixes: #4812

Adds a new data source for IAM testable permissions.

data "google_iam_testable_permissions" "perms" {
	full_resource_name   = "//cloudresourcemanager.googleapis.com/projects/my-project"
        custom_support_level = "NOT_SUPPORTED"
        stages               = ["GA", "BETA"]
}

output "perms" {
	value = data.google_iam_testable_permissions.perms.permissions
}

Then the output will look like this:

$ terraform apply
data.google_iam_testable_permissions.perms: Refreshing state...

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

perms = [
  {
    "api_disabled" = false
    "custom_support_level" = "NOT_SUPPORTED"
    "name" = "appengine.runtimes.actAsAdmin"
    "stage" = "GA"
    "title" = ""
  },
  {
    "api_disabled" = false
    "custom_support_level" = "NOT_SUPPORTED"
    "name" = "cloudsql.sslCerts.createEphemeral"
    "stage" = "GA"
    "title" = ""
  },

Derived from GoogleCloudPlatform/magic-modules#3460

* Added new data source for iam_testable_permissions

* Added tests and docs

* Fixed linter errors

* Use sdk validation package and allow case-insensitive

* Changed stage to stages list and concat results

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician merged commit 707a1e6 into hashicorp:master May 14, 2020
@ghost
Copy link

ghost commented Jun 14, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

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

Successfully merging this pull request may close these issues.

Add customrolessupportlevel filtered attribute to d/google_iam_role testable_permissions data source
1 participant