GoogleCloudPlatform / GoogleCloudPlatform/gcc-creative-studio

logging_writer grant to Trigger SA may be duplicated

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
144
Forks
385
Avg merge
1d 46m
Merged PRs (30d)
5

Description

`google_service_account.trigger_sa.email` might have redundant grants in the terraform modules

In [infra/modules/firebase-hosting-service/main.tf#L53-L58](https://github.com/GoogleCloudPlatform/gcc-creative-studio/blob/b9c42a17edbcf70e7fa5111e74fd4021655b0ab1/infra/modules/firebase-hosting-service/main.tf#L53-L58):
```
# 5. Give the trigger SA permission to write logs
resource "google_project_iam_member" "logging_writer" {
project = var.gcp_project_id
role = "roles/logging.logWriter"
member = "serviceAccount:${google_service_account.trigger_sa.email}"
}
```

And in [infra/modules/cloud-run-service/main.tf](https://github.com/GoogleCloudPlatform/gcc-creative-studio/blob/b9c42a17edbcf70e7fa5111e74fd4021655b0ab1/infra/modules/cloud-run-service/main.tf#L148-L152):
```
resource "google_project_iam_member" "logging_writer_binding" {
project = var.gcp_project_id
role = "roles/logging.logWriter"
member = "serviceAccount:${google_service_account.trigger_sa.email}"
}
```

Since `google_project_iam_member` is non-authoritative this should be safe but Terraform will still track both entries in the state, flagging to verify whether it's intended or not.

Contributor guide

Open the contributing guide

Research direction

Read infra/modules/firebase-hosting-service/main.tf around lines 53-58 and infra/modules/cloud-run-service/main.tf around lines 148-152, then inspect how both modules are used. Run the relevant Terraform plan or state inspection to verify whether the two logging.logWriter grants produce a redundant state entry. Done means the intended grant ownership is clear and the duplicate concern is resolved or documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
terraform
Domain
authorization, cloud, infrastructure
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.