Skip to content

Commit

Permalink
chores: add at22 (#91)
Browse files Browse the repository at this point in the history
* add env suffix for mass transit role

* add mass transit custom role with env suffix

* add CI infra

* rename templates
  • Loading branch information
andreasisnes authored Nov 14, 2024
1 parent 6eb6688 commit 78f46c9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_ci-infra-template.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Template: Deploy Infra"
name: "Template: Terraform CI"

on:
workflow_call:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_deploy-app-terraform.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: infra-cd-template.yml
name: "Template: Terraform CD"

on:
workflow_call:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
cert:
name: Cert
secrets: inherit
uses: ./.github/workflows/_deploy-infra-template.yml
uses: ./.github/workflows/_ci-infra-template.yml
with:
environment: at21
tf_state: cert.tfstate
Expand All @@ -21,7 +21,7 @@ jobs:
auth:
name: Auth
secrets: inherit
uses: ./.github/workflows/_deploy-infra-template.yml
uses: ./.github/workflows/_ci-infra-template.yml
with:
environment: at21
tf_state: auth.tfstate
Expand All @@ -30,7 +30,7 @@ jobs:
register:
name: Altinn Register
secrets: inherit
uses: ./.github/workflows/_deploy-infra-template.yml
uses: ./.github/workflows/_ci-infra-template.yml
with:
environment: at21
tf_state: Altinn.Register.tfstate
Expand Down
2 changes: 1 addition & 1 deletion infra/deploy/altinn-register/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ resource "azurerm_role_assignment" "mass_transit_role" {
scope = data.azurerm_servicebus_namespace.sb.id
principal_type = "ServicePrincipal"
skip_service_principal_aad_check = true
role_definition_name = "Azure Service Bus Mass Transit"
role_definition_name = "Azure Service Bus Mass Transit ${upper(var.environment)}"
}

resource "azurerm_role_assignment" "key_vault_secret_reader" {
Expand Down
2 changes: 1 addition & 1 deletion infra/modules/container_app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ resource "azurerm_role_assignment" "rbac" {
{
id = "service_bus_mass_transit"
scope = data.azurerm_servicebus_namespace.sb.id
role_definition_name = "Azure Service Bus Mass Transit"
role_definition_name = "Azure Service Bus Mass Transit ${upper(var.environment)}"
should_assign = var.can_use_service_bus
},
{
Expand Down
2 changes: 1 addition & 1 deletion infra/modules/container_app_api/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ resource "azurerm_role_assignment" "rbac" {
{
id = "service_bus_mass_transit"
scope = data.azurerm_servicebus_namespace.sb.id
role_definition_name = "Azure Service Bus Mass Transit"
role_definition_name = "Azure Service Bus Mass Transit ${upper(var.environment)}"
should_assign = var.can_use_auth_service_bus
},
{
Expand Down
2 changes: 1 addition & 1 deletion infra/modules/service_bus/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ resource "azurerm_private_endpoint" "service_bus_private_endpoint" {
# Service bus Actions List: https://learn.microsoft.com/en-us/azure/role-based-access-control/permissions/integration#microsoftservicebus
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_definition
resource "azurerm_role_definition" "service_bus_masstransit" {
name = "Azure Service Bus Mass Transit"
name = "Azure Service Bus Mass Transit ${upper(var.metadata.environment)}"
scope = azurerm_servicebus_namespace.service_bus.id
description = "Allow C# Applications use MassTransit with Azure Service Bus"

Expand Down

0 comments on commit 78f46c9

Please sign in to comment.