Skip to content

Make grok-bot read-only for pulumi preview - #16

Merged
dubinsky merged 1 commit into
masterfrom
cursor/grok-bot-readonly-8e41
Nov 18, 2026
Merged

dubinsky merged 1 commit into
masterfrom
cursor/grok-bot-readonly-8e41

Conversation

@dubinsky

Copy link
Copy Markdown
Owner

Summary

grok-bot can run pulumi preview and preview --refresh. Its organization roles are no longer the terraform list, and it is no longer a key admin of its own key.

  • Organization roles come from grokBotServiceAccountOrganizationRoles, which a stack can override the same way as terraformServiceAccountOrganizationRoles. The default is browser, iam.securityReviewer, iam.serviceAccountViewer, serviceusage.serviceUsageViewer, billing.viewer, and storage.bucketViewer. Terraform's role list is unchanged.
  • terraform keeps iam.serviceAccountKeyAdmin on grok-bot (keyAdmin:terraform). grok-bot does not grant that role to itself. iam.serviceAccountViewer covers keys.get.
  • storage.objectViewer is granted on the state bucket only, through the existing BucketIam helper. storage.bucketViewer on the organization covers bucket metadata.
  • The account description is Read-only service account for Grok Bot previews.

Logical names of retained resources stay the same: the service account, the key (serviceAccount:grok-bot@<project>-key), keyAdmin:terraform, and terraform's organization members. Version literals 9.0.0 and 6.20.0 stay inline. The new bucket binding is a sibling BucketIam, the same Output depth as the existing helper.

./gradlew build and ./gradlew -p domain-infra/besom compileScala pass. This does not publish.

Expected per-stack preview diff

<project> is that stack's infra project id. <domain> is the stack domain. Write roles are whatever the stack currently passes as terraformServiceAccountOrganizationRoles.

Deletes

  • gcp:organizations/iAMMember:IAMMember serviceAccount:grok-bot@<project>/role:<write-role> — one per write role grok-bot currently shares with terraform. Terraform's own members stay.
  • gcp:serviceaccount/iAMMember:IAMMember serviceAccount:grok-bot@<project>/keyAdmin:grok-bot

Creates

  • gcp:organizations/iAMMember:IAMMember, one per default read-only role (a stack that overrides grokBotServiceAccountOrganizationRoles creates that list instead):
    • serviceAccount:grok-bot@<project>/role:browser
    • serviceAccount:grok-bot@<project>/role:iam.securityReviewer
    • serviceAccount:grok-bot@<project>/role:iam.serviceAccountViewer
    • serviceAccount:grok-bot@<project>/role:serviceusage.serviceUsageViewer
    • serviceAccount:grok-bot@<project>/role:billing.viewer
    • serviceAccount:grok-bot@<project>/role:storage.bucketViewer
  • gcp:storage/bucketIAMMember:BucketIAMMember state.<domain>/serviceAccount:grok-bot@<project>/role:storage.objectViewer

Update

  • gcp:serviceaccount/account:Account serviceAccount:grok-bot@<project> — description becomes Read-only service account for Grok Bot previews.

Unchanged

  • gcp:serviceaccount/key:Key serviceAccount:grok-bot@<project>-key. Key inputs (serviceAccountId, privateKeyType) are unchanged. dependsOn only drops the deleted key-admin member.
  • gcp:serviceaccount/iAMMember:IAMMember serviceAccount:grok-bot@<project>/keyAdmin:terraform
  • the terraform service account and its organization roles
Open in Web Open in Cursor 

Co-authored-by: Leonid Dubinsky <dub@podval.org>
@dubinsky
dubinsky merged commit 388ee22 into master Nov 18, 2026
2 checks passed
@dubinsky
dubinsky deleted the cursor/grok-bot-readonly-8e41 branch November 18, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant