Skip to content

Commit

Permalink
Add Pytest Service Account to Staging (#3733)
Browse files Browse the repository at this point in the history
* Add Pytest Service Account to Staging
* Allow terraform plan to write a pull request comment

---------

Signed-off-by: Erika Pacheco <erika@ministryofvelocity.com>
  • Loading branch information
ohrite authored Feb 20, 2025
1 parent 0d1d11b commit 5e22e35
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
pull-requests: 'write'

strategy:
fail-fast: false
Expand Down Expand Up @@ -84,6 +85,7 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
pull-requests: 'write'

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion iac/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Initialize Terraform:
$ terraform init
```

Run `terraform init` against each nested resource using `make plan`:
Run `terraform init` against each nested resource using `make init`:

```bash
$ cd iac/
Expand Down
6 changes: 6 additions & 0 deletions iac/cal-itp-data-infra-staging/iam/us/project_iam_member.tf
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,9 @@ resource "google_project_iam_member" "tfer--terraform-membership" {
member = "serviceAccount:${google_service_account.tfer--terraform.email}"
project = "cal-itp-data-infra-staging"
}

resource "google_project_iam_member" "tfer--pytest-membership" {
member = "serviceAccount:${google_service_account.tfer--pytest.email}"
project = "cal-itp-data-infra-staging"
role = "roles/storage.objectViewer"
}
8 changes: 8 additions & 0 deletions iac/cal-itp-data-infra-staging/iam/us/service_account.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ resource "google_service_account" "tfer--terraform" {
display_name = "Terraform"
project = "cal-itp-data-infra-staging"
}

resource "google_service_account" "tfer--pytest" {
account_id = "github-actions-pytest"
description = "Service account for Github Actions to run tests"
disabled = "false"
display_name = "pytest"
project = "cal-itp-data-infra-staging"
}

0 comments on commit 5e22e35

Please sign in to comment.