GoogleCloudPlatform / GoogleCloudPlatform/cloud-run-button
Allow app.json to list required IAM roles
- Dominant language
- Go
- Stars
- 553
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
This feature would allow users to run with non-default service accounts created just for that application.
@mchmarny said that the default Run app identity doesn't have enough permissions to create a PubSub topic to one-click-deploy his app. (Ideally it should, since GCE default svc account has `Editor` role, so I'll investigate that separately).
But if we needed this someday, the strawman design would be like:
app.json:
```json
{
"roles": [
"roles/storage.objectAdmin",
"roles/pubsub.subscriber"
]
}
```
When this field specifies, we should prompt the user with a confirmation saying a "service account with permissions [..., ...] will be created or re-used by the deployed application".
Then we would create a Cloud IAM Service Account that has the **same name** as the Run app name. (It would assign the listed roles on the project-level to that service account. It wouldn't remove extra role bindings that are already there, as they may be added by the user.)
If the account exists, we should have a way of verifying it was created by cloud-run-button (somehow through a marker). If so, we can reuse it (by making sure the role bindings listed in app.json exist).
But I'm not sure if we need this feature just yet, since technically GCE Default Service Account is an `Editor` and it should be able to bootstrap its needs just fine.
Contributor guide
Assessment
This issue has not been assessed yet.