|
| 1 | +# resource "google_service_account" "apiserver" { |
| 2 | +# depends_on = [google_project_service.iam-api] |
| 3 | +# account_id = "apiserver" |
| 4 | +# display_name = "API server" |
| 5 | +# } |
| 6 | + |
| 7 | + |
| 8 | +# resource "google_service_account" "infra-ci-bot" { |
| 9 | +# depends_on = [google_project_service.iam-api] |
| 10 | +# account_id = "infra-ci-bot" |
| 11 | +# display_name = "Infrastructure CI bot" |
| 12 | +# } |
| 13 | + |
| 14 | +# resource "google_service_account_key" "infra-ci-bot-sa-key" { |
| 15 | +# service_account_id = google_service_account.infra-ci-bot.name |
| 16 | +# } |
| 17 | + |
| 18 | + |
| 19 | +# resource "google_service_account" "server-edition-ci-bot" { |
| 20 | +# depends_on = [google_project_service.iam-api] |
| 21 | +# account_id = "server-edition-ci-bot" |
| 22 | +# display_name = "Server Edition CI bot" |
| 23 | +# } |
| 24 | + |
| 25 | +# resource "google_service_account_key" "server-editions-ci-bot-sa-key" { |
| 26 | +# service_account_id = google_service_account.server-edition-ci-bot.name |
| 27 | +# } |
| 28 | + |
| 29 | +data "azuread_group" "infra-maintainers" { |
| 30 | + display_name = "Fullstaq Ruby Infra Maintainers" |
| 31 | + security_enabled = true |
| 32 | +} |
| 33 | + |
| 34 | + |
| 35 | +resource "azuread_application" "server-edition-github-ci-test" { |
| 36 | + display_name = "Server Edition Github CI (test)" |
| 37 | + owners = [azuread_group.infra-maintainers.id] |
| 38 | +} |
| 39 | + |
| 40 | +resource "azuread_application_federated_identity_credential" "server-edition-github-ci-test" { |
| 41 | + application_id = azuread_application_registration.server-edition-github-ci-test.application_id |
| 42 | + display_name = "Server Edition Github CI (test)" |
| 43 | + audiences = ["api://AzureADTokenExchange"] |
| 44 | + issuer = "https://token.actions.githubusercontent.com" |
| 45 | + subject = "repo:fullstaq-ruby/server-edition:environment:test" |
| 46 | +} |
| 47 | + |
| 48 | +resource "azuread_service_principal" "server-edition-github-ci-test" { |
| 49 | + client_id = azuread_application.server-edition-github-ci-test.application_id |
| 50 | + owners = [azuread_group.infra-maintainers.id] |
| 51 | +} |
| 52 | + |
| 53 | + |
| 54 | +resource "azuread_application" "server-edition-github-ci-deploy" { |
| 55 | + display_name = "Server Edition Github CI (deploy)" |
| 56 | + owners = [azuread_group.infra-maintainers.id] |
| 57 | +} |
| 58 | + |
| 59 | +resource "azuread_application_federated_identity_credential" "server-edition-github-ci-deploy" { |
| 60 | + application_id = azuread_application_registration.server-edition-github-ci-deploy.application_id |
| 61 | + display_name = "Server Edition Github CI (deploy)" |
| 62 | + audiences = ["api://AzureADTokenExchange"] |
| 63 | + issuer = "https://token.actions.githubusercontent.com" |
| 64 | + subject = "repo:fullstaq-ruby/server-edition:environment:deploy" |
| 65 | +} |
| 66 | + |
| 67 | +resource "azuread_service_principal" "server-edition-github-ci-deploy" { |
| 68 | + client_id = azuread_application.server-edition-github-ci-deploy.application_id |
| 69 | + owners = [azuread_group.infra-maintainers.id] |
| 70 | +} |
0 commit comments