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.33k stars 1.74k forks source link

VertexAI Custom IAM Permission Creation Errors #18976

Open BatoolKad opened 3 months ago

BatoolKad commented 3 months ago

Community Note

Terraform Version & Provider Version(s)

Terraform v1.9.3 on google

Affected Resource(s)

*google_project_iam_custom_role

Terraform Configuration

resource "google_project_iam_custom_role" "X_custom_role" {
  role_id     = "customXRrole"
  title       = "XCustom Role"
  description = "Custom roles for X"
  project     = var.project

  permissions = [

    # Workbench roles
    " aiplatform.notebookExecutionJobs.create",
    "aiplatform.notebookExecutionJobs.delete",
    "aiplatform.notebookExecutionJobs.get",
    "aiplatform.notebookExecutionJobs.list",
    "aiplatform.notebookRuntimeTemplates.apply",
    "aiplatform.notebookRuntimeTemplates.create",
    "aiplatform.notebookRuntimeTemplates.delete",
    "aiplatform.notebookRuntimeTemplates.get",
    "aiplatform.notebookRuntimeTemplates.list",
    "aiplatform.notebookRuntimeTemplates.update"]
}

Debug Output

image

Expected Behavior

It should create a custom role with the provided permissions, but it keeps giving me an error. But When I create other roles for BigQuery for example it did not give me this error!

Actual Behavior

Error: Error creating the custom project role projects/####/roles/customXRole: googleapi: Error 400: Permission aiplatform.notebookExecutionJobs.create is not valid., badRequest

Steps to reproduce

Copy the terraform configuration

Run terraform apply

Important Factoids

No response

References

https://cloud.google.com/iam/docs/understanding-roles#ai-notebooks-roles

ggtisc commented 3 months ago

Hi @BatoolKad !

Did you notice that you have a blank space for the " aiplatform.notebookExecutionJobs.create"? You need to be sure that all the roles you are using have the correct nomenclature and are written correctly. I suggest that before running a terraform apply be sure that everything is written and saved correctly.