Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for service account IAM variables to pf #2130

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

ludoo
Copy link
Collaborator

@ludoo ludoo commented Mar 5, 2024

This PR extends the project factory so that its fundamental design principle -- that the pf mostly wraps modules and exposes their full interface -- is also true for service accounts.

The practical use cases for this change are several, for example:

  • assigning compute/networkUser role on shared VPC hosts to GCE service accounts
  • assigning arbitrary additive project/storage/folder/org/billing roles to application-level service accounts

The project factory interface for service accounts still supports as its default use case assigning roles to the project defined in YAML where the service accounts is created, with a slight change in names: where before we used iam_project_roles to specify the list of roles for the current project, we now use iam_self_roles as the previous name clashes with the underlying service account module's interface.

The new interface looks like this:

```yaml
service_accounts:
  be-0: {}
  fe-1:
    display_name: GCE frontend service account.
    iam_self_roles:
      - roles/storage.objectViewer
    iam_project_roles:
      my-host-project:
        - roles/compute.networkUser

@ludoo ludoo requested a review from sruffilli March 5, 2024 11:43
@ludoo ludoo added the incompatible change Pull request that breaks compatibility with previous version label Mar 5, 2024
@ludoo ludoo merged commit 39139e2 into master Mar 5, 2024
13 checks passed
@ludoo ludoo deleted the ludo/pf-iam-sa-roles branch March 5, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatible change Pull request that breaks compatibility with previous version on:modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants