|
| 1 | +data "azuread_group" "relops" { |
| 2 | + display_name = "Relops" |
| 3 | + security_enabled = true |
| 4 | +} |
| 5 | + |
| 6 | +resource "azuread_application" "ronin_puppet_test_kitchen" { |
| 7 | + display_name = "ronin-puppet-test-kitchen" |
| 8 | + owners = data.azuread_group.relops.members |
| 9 | + |
| 10 | + web { |
| 11 | + homepage_url = "https://github.com/mozilla-platform-ops/ronin_puppet" |
| 12 | + |
| 13 | + implicit_grant { |
| 14 | + access_token_issuance_enabled = false |
| 15 | + id_token_issuance_enabled = true |
| 16 | + } |
| 17 | + } |
| 18 | +} |
| 19 | + |
| 20 | +resource "azuread_service_principal" "ronin_puppet_test_kitchen" { |
| 21 | + client_id = azuread_application.ronin_puppet_test_kitchen.client_id |
| 22 | + tags = concat(["name:ronin-puppet-test-kitchen"], local.sp_tags) |
| 23 | + owners = data.azuread_group.relops.members |
| 24 | +} |
| 25 | + |
| 26 | +resource "azurerm_role_assignment" "ronin_puppet_test_kitchen_contributor" { |
| 27 | + role_definition_name = "Contributor" |
| 28 | + principal_id = azuread_service_principal.ronin_puppet_test_kitchen.object_id |
| 29 | + scope = data.azurerm_subscription.currentSubscription.id |
| 30 | +} |
| 31 | + |
| 32 | +resource "azuread_application_federated_identity_credential" "ronin_puppet_test_kitchen_pr" { |
| 33 | + application_id = azuread_application.ronin_puppet_test_kitchen.id |
| 34 | + display_name = "github-actions-pr" |
| 35 | + description = "GitHub Actions OIDC for pull_request workflows in mozilla-platform-ops/ronin_puppet" |
| 36 | + audiences = ["api://AzureADTokenExchange"] |
| 37 | + issuer = "https://token.actions.githubusercontent.com" |
| 38 | + subject = "repo:mozilla-platform-ops/ronin_puppet:pull_request" |
| 39 | +} |
| 40 | + |
| 41 | +resource "azuread_application_federated_identity_credential" "ronin_puppet_test_kitchen_branches" { |
| 42 | + application_id = azuread_application.ronin_puppet_test_kitchen.id |
| 43 | + display_name = "github-actions-branches" |
| 44 | + description = "GitHub Actions OIDC for branch workflows in mozilla-platform-ops/ronin_puppet" |
| 45 | + audiences = ["api://AzureADTokenExchange"] |
| 46 | + issuer = "https://token.actions.githubusercontent.com" |
| 47 | + subject = "repo:mozilla-platform-ops/ronin_puppet:ref:refs/heads/*" |
| 48 | +} |
0 commit comments