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
50 changes: 25 additions & 25 deletions atlantis.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
version: 3
automerge: true
projects:
- dir: projects/gcp
workflow: default
autoplan:
when_modified: ["*.tf", "*.yaml", "*.json", "../../modules/**/*.tf", "../../modules/**/*.yaml", "../../modules/**/*.json"]
enabled: true
- dir: projects/core
workflow: default
autoplan:
when_modified: ["*.tf", "*.yaml", "*.json", "../../modules/**/*.tf", "../../modules/**/*.yaml", "../../modules/**/*.json"]
enabled: true
- dir: projects/core/config
workflow: default
autoplan:
when_modified: ["*.tf", "*.yaml", "*.json", "../../../modules/**/*.tf", "../../../modules/**/*.yaml", "../../../modules/**/*.json"]
enabled: true
- dir: projects/domain
workflow: default
autoplan:
when_modified: ["*.tf", "*.yaml", "*.json", "../../../modules/**/*.tf", "../../../modules/**/*.yaml", "../../../modules/**/*.json"]
enabled: true
- dir: projects/infra
workflow: default
autoplan:
when_modified: ["*.tf", "*.yaml", "*.json", "../../../modules/**/*.tf", "../../../modules/**/*.yaml", "../../../modules/**/*.json"]
enabled: true
# - dir: projects/gcp
# workflow: default
# autoplan:
# when_modified: ["*.tf", "*.yaml", "*.json", "../../modules/**/*.tf", "../../modules/**/*.yaml", "../../modules/**/*.json"]
# enabled: true
# - dir: projects/core
# workflow: default
# autoplan:
# when_modified: ["*.tf", "*.yaml", "*.json", "../../modules/**/*.tf", "../../modules/**/*.yaml", "../../modules/**/*.json"]
# enabled: true
# - dir: projects/core/config
# workflow: default
# autoplan:
# when_modified: ["*.tf", "*.yaml", "*.json", "../../../modules/**/*.tf", "../../../modules/**/*.yaml", "../../../modules/**/*.json"]
# enabled: true
# - dir: projects/domain
# workflow: default
# autoplan:
# when_modified: ["*.tf", "*.yaml", "*.json", "../../../modules/**/*.tf", "../../../modules/**/*.yaml", "../../../modules/**/*.json"]
# enabled: true
# - dir: projects/infra
# workflow: default
# autoplan:
# when_modified: ["*.tf", "*.yaml", "*.json", "../../../modules/**/*.tf", "../../../modules/**/*.yaml", "../../../modules/**/*.json"]
# enabled: true
43 changes: 43 additions & 0 deletions modules/gcp/iam/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,46 @@ resource "google_service_account_iam_binding" "service_account_token_creator" {
"user:goboolean.io@gmail.com"
]
}


resource "google_iam_workload_identity_pool" "github_pool" {
workload_identity_pool_id = "github-pool"
display_name = "GitHub Actions Pool"
description = "Pool for GitHub Actions workflows"
disabled = false
}

resource "google_iam_workload_identity_pool_provider" "github_provider" {
workload_identity_pool_id = google_iam_workload_identity_pool.github_pool.workload_identity_pool_id
workload_identity_pool_provider_id = "github-pool-provider"
display_name = "GitHub Provider"
description = "OIDC provider for GitHub Actions"

oidc {
issuer_uri = "https://token.actions.githubusercontent.com"
}

attribute_mapping = {
"google.subject" = "assertion.sub"
"attribute.repository" = "assertion.repository"
"attribute.repository_owner" = "assertion.repository_owner"
}
}

resource "google_service_account" "github_sa" {
account_id = "github-actions-sa"
display_name = "GitHub Actions Service Account"
description = "Service account for GitHub Actions workflows"
}

resource "google_project_iam_member" "sa_role" {
project = var.project_id
role = "roles/storage.admin"
member = "serviceAccount:${google_service_account.github_sa.email}"
}

resource "google_service_account_iam_member" "workload_identity_user" {
service_account_id = google_service_account.github_sa.name
role = "roles/iam.workloadIdentityUser"
member = "principal://iam.googleapis.com/${google_iam_workload_identity_pool.github_pool.name}/attribute.repository_owner/goboolean"
}
2 changes: 2 additions & 0 deletions modules/gcp/service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ locals {
"storage.googleapis.com",
"secretmanager.googleapis.com",
"cloudkms.googleapis.com",
"iamcredentials.googleapis.com",
"sts.googleapis.com"
])
}

Expand Down