Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/beam_Infrastructure_UsersPermissions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

# This workflow modifies the GCP User Roles when the infra/users.yml file is updated.
# It applies the changes using Terraform to manage the IAM roles for users defined in the users.yml
# If the workflow is triggered by a pull request, it will post the Terraform plan as a comment on the PR
# as a code block for easy review.

name: Modify the GCP User Roles according to the infra/users.yml file

Expand All @@ -28,6 +30,10 @@ on:
- main
paths:
- 'infra/iam/users.yml'
pull_request_target:
types: [opened, synchronize, reopened]
paths:
- 'infra/iam/users.yml'

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
Expand All @@ -36,7 +42,8 @@ concurrency:

#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event
permissions:
contents: read
contents: write
pull-requests: write

jobs:
beam_UserRoles:
Expand All @@ -57,6 +64,28 @@ jobs:
- name: Terraform Plan
working-directory: ./infra/iam
run: terraform plan -out=tfplan

- name: Convert plan to plaintext
if: github.event_name == 'pull_request_target'
working-directory: ./infra/iam
run: terraform show -no-color tfplan > tfplan.txt

- name: Create comment body
if: github.event_name == 'pull_request_target'
run: |
echo "### Terraform Plan for User Roles Changes" > comment_body.txt
echo '```' >> comment_body.txt
cat ./infra/iam/tfplan.txt >> comment_body.txt
echo '```' >> comment_body.txt

- name: Upload plan as a comment to PR
if: github.event_name == 'pull_request_target'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: gh pr comment ${{ github.event.pull_request.number }} --body-file comment_body.txt

- name: Terraform Apply
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'apache/beam'
working-directory: ./infra/iam
run: terraform apply -auto-approve tfplan
15 changes: 5 additions & 10 deletions infra/iam/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,12 @@
# limitations under the License.

# IAM policy for project apache-beam-testing
# Generated on 2025-09-19 18:17:58 UTC
# Generated on 2025-10-07 16:00:39 UTC

- username: WhatWouldAustinDo
email: WhatWouldAustinDo@gmail.com
permissions:
- role: roles/editor
- username: a.khorbaladze
email: a.khorbaladze@akvelon.us
permissions:
- role: roles/bigquery.admin
- role: roles/container.admin
- role: roles/editor
- role: roles/iam.serviceAccountUser
- role: roles/secretmanager.admin
- username: aaronleeiv
email: aaronleeiv@google.com
permissions:
Expand Down Expand Up @@ -84,6 +76,7 @@
- role: roles/iam.serviceAccountTokenCreator
- role: roles/iam.serviceAccountUser
- role: roles/iam.workloadIdentityUser
- role: roles/storage.objectAdmin
- role: roles/viewer
- username: allows-impersonation-new
email: allows-impersonation-new@apache-beam-testing.iam.gserviceaccount.com
Expand Down Expand Up @@ -197,6 +190,7 @@
- role: roles/managedkafka.schemaRegistryEditor
- role: roles/monitoring.metricWriter
- role: roles/monitoring.viewer
- role: roles/secretmanager.admin
- role: roles/spanner.databaseAdmin
- role: roles/stackdriver.resourceMetadata.writer
- role: roles/storage.admin
Expand Down Expand Up @@ -238,6 +232,7 @@
- role: roles/iam.serviceAccountTokenCreator
- role: roles/iam.serviceAccountUser
- role: roles/pubsub.admin
- role: roles/secretmanager.admin
- role: roles/spanner.admin
- role: roles/storage.admin
- role: roles/storage.folderAdmin
Expand Down Expand Up @@ -372,7 +367,7 @@
- username: enriquecaol04
email: enriquecaol04@gmail.com
permissions:
- role: roles/viewer
- role: projects/apache-beam-testing/roles/beam_viewer
- username: eventarc-workflow-sa
email: eventarc-workflow-sa@apache-beam-testing.iam.gserviceaccount.com
permissions:
Expand Down
Loading