yeshwanth14 / Test1

0 stars 0 forks source link

Terraform Permissions Denied Issue (403) while creating GCP notification Alerts and channels in Specific Project. #15

Open yeshwanth14 opened 1 month ago

yeshwanth14 commented 1 month ago

Hi,

I am encountering issues when attempting to create Google Cloud Platform (GCP) notification channels and alerts using Terraform for a specific project. Despite having the same permissions (including being an owner) across all projects, and having all required Monitoring APIs enabled, I receive a 403 Forbidden error when working with this particular project. I have verified that I have set up a service account with the appropriate roles, including Monitoring Editor, Monitoring AlertPolicy Editor, and Monitoring NotificationChannel Editor and tried changing the terraform providers, yet the issue persists. (Attached the Terraform Debug Logs)

Interestingly, I am able to create notification channels and alerts in other projects without any issues. This problem has been ongoing for over 35 days. FYI i'm able to create them via GCP Console for this project (glan-common-apigee-test), Terraform import also works

I would appreciate any assistance or guidance on resolving this issue.

google_monitoring_notification_channel.basic: Creating... ╷ │ Error: Error creating NotificationChannel: googleapi: Error 403: Permission denied (or the resource may not exist). │ │ with google_monitoring_notification_channel.basic, │ on main.tf line 1, in resource "google_monitoring_notification_channel" "basic": │ 1: resource "google_monitoring_notification_channel" "basic" {

terraform logs:-

-------------------

project:- glan-common-apigee-test (not working)

2024-07-26T19:26:30.282+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:26:30 [DEBUG] Waiting for state to become: [success] 2024-07-26T19:26:30.584+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:26:30 [INFO] Terraform is using this identity: mallam@glan.com 2024-07-26T19:26:30.585+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:26:30 [DEBUG] parent context canceled, cleaning up batcher batches 2024-07-26T19:26:30.585+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:26:30 [DEBUG] Stopping batcher "Service Usage" 2024-07-26T19:26:30.585+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:26:30 [DEBUG] parent context canceled, cleaning up batcher batches 2024-07-26T19:26:30.585+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:26:30 [DEBUG] Stopping batcher "IAM" 2024-07-26T19:26:30.599+0530 [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_monitoring_notification_channel.basic, but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations:

######################################################################################

project:- glan-sandbox-ai (worked)

2024-07-26T19:23:58.381+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:23:58 [DEBUG] Waiting for state to become: [success] 2024-07-26T19:23:58.692+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:23:58 [INFO] Terraform is using this identity: mallam@glan.com 2024-07-26T19:23:58.693+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:23:58 [DEBUG] parent context canceled, cleaning up batcher batches 2024-07-26T19:23:58.693+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:23:58 [DEBUG] Stopping batcher "Service Usage" 2024-07-26T19:23:58.693+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:23:58 [DEBUG] parent context canceled, cleaning up batcher batches 2024-07-26T19:23:58.693+0530 [DEBUG] provider.terraform-provider-google_v5.38.0_x5: 2024/07/26 19:23:58 [DEBUG] Stopping batcher "IAM" 2024-07-26T19:23:58.705+0530 [WARN] Provider "registry.terraform.io/hashicorp/google" produced an invalid plan for google_monitoring_notification_channel.basic, but we are tolerating it because it is using the legacy plugin SDK. The following problems may be the cause of any confusing errors from downstream operations:

yeshwanth14 commented 1 month ago

Any help would be appreciated to resolving this issue!!