hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.36k stars 1.75k forks source link

Role roles/iap.tunnelInstances.accessViaIAP is not supported for google_project_iam resource #19803

Open serpro69 opened 1 month ago

serpro69 commented 1 month ago

Community Note

Terraform Version & Provider Version(s)

Terraform v1.9.1 on linux_amd64

Affected Resource(s)

google_project_iam_binding google_project_iam_member

Terraform Configuration

resource "google_project_iam_binding" "iap_tunnel_access" {
  project = var.project_id
  role    = "roles/iap.tunnelInstances.accessViaIAP"
  members = ["user:bar@baz.test"]
}

or

resource "google_project_iam_member" "iap_tunnel_access" {
  project = var.project_id
  role    = "roles/iap.tunnelInstances.accessViaIAP"
  member  = "user:bar@baz.test"
}

Debug Output

No response

Expected Behavior

I can set this fine via UI console, so terraform should be able to do the same via APIs?

Actual Behavior

Tried both iam binding and member resources, and both return the same error:

β”‚ Error: Request `Set IAM Binding for role "roles/iap.tunnelInstances.accessViaIAP" on "project \"foo\""` returned error: Error applying IAM policy for project "foo": googleapi: Error 400: Role roles/iap.tunnelInstances.accessViaIAP is not supported for this resource., badRequest
β”‚ Error: Request `Create IAM Members roles/iap.tunnelInstances.accessViaIAP user:bar@baz.test for project "foo\"" both failed. Final error: Error applying IAM policy for project "foo": googleapi: Error 400: Role roles/iap.tunnelInstances.accessViaIAP is not supported for this resource., badRequest

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

No response

b/372713789

ggtisc commented 1 month ago

Confirmed issue!

After trying to create both resources they returned the described error and there isn't any list specifying if there are roles that aren't supported for these resources in terraform registry:

β”‚ Error: RequestSet IAM Binding for role "roles/iap.tunnelInstances.accessViaIAP" on "project \"foo\""returned error: Error applying IAM policy for project "foo": googleapi: Error 400: Role roles/iap.tunnelInstances.accessViaIAP is not supported for this resource., badRequest