Open snahim-g opened 2 years ago
@snahim-g Thanks for the report. The folder resource "name" output from the folder resource actually has the id and is of form folders/{folder_id}
. The module should accept both strings that are just ids or google_folder.iac_folder.name
. Let me know if this works.
https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_folder#name
@bharathkkb We might want to consider changing the variable to folder_ids
. Even though name
is the technical definition, it's definitely confusing given the presence of display_name
as well.
Changing this to FR.
TL;DR
Using a folder name for the folder-iam module errors out as the folder name is invalie.
Expected behavior
Adding iam roles
Observed behavior
│ Error: Error retrieving IAM policy for folder "folders/xxx-shared-iac": googleapi: Error 400: Request contains an invalid argument. │ Details: │ [ │ { │ "@type": "type.googleapis.com/google.rpc.DebugInfo", │ "detail": "[ORIGINAL ERROR] generic::invalid_argument: com.google.apps.framework.request.BadRequestException: Invalid folder resource name: folders/xxx │ ] │ , badRequest │ │ with module.iac-folder-iam.google_folder_iam_member.folder_iam_additive["default--roles/resourcemanager.folderEditor--user:xxxxx@xxxx.xxx.net"], │ on .terraform/modules/iac-folder-iam/modules/folders_iam/main.tf line 49, in resource "google_folder_iam_member" "folder_iam_additive": │ 49: resource "google_folder_iam_member" "folder_iam_additive" { │ ╵
Terraform Configuration
Terraform Version
Additional information
Honestly not sure why my folder name would be used here? Wouldn't GCP require a folder ID?