-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
whitespace, different userg assigned identities for backend and frontend
- Loading branch information
Showing
17 changed files
with
119 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,36 @@ | ||
resource "azurerm_user_assigned_identity" "imo_app_cr" { | ||
name = "id-${var.app}-assign-id-cr-${var.env}" | ||
resource "azurerm_user_assigned_identity" "backend" { | ||
name = "id-${var.app}-backend-${var.env}" | ||
resource_group_name = var.resource_group_name | ||
location = var.location | ||
} | ||
|
||
resource "azurerm_user_assigned_identity" "imo_app_vault" { | ||
name = "id-${var.app}-assign-id-vault-${var.env}" | ||
resource "azurerm_user_assigned_identity" "frontend" { | ||
name = "id-${var.app}-frontend-${var.env}" | ||
resource_group_name = var.resource_group_name | ||
location = var.location | ||
} | ||
|
||
resource "azurerm_role_assignment" "acr_pull" { | ||
resource "azurerm_role_assignment" "acr_pull_backend" { | ||
scope = var.container_registry_id | ||
role_definition_name = "acrpull" | ||
principal_id = azurerm_user_assigned_identity.imo_app_cr.principal_id | ||
depends_on = [ | ||
azurerm_user_assigned_identity.imo_app_cr | ||
] | ||
principal_id = azurerm_user_assigned_identity.backend.principal_id | ||
} | ||
|
||
resource "azurerm_role_assignment" "admin_key_vault" { | ||
scope = var.resource_group_id | ||
role_definition_name = "Key Vault Administrator" | ||
principal_id = var.azure_current_object_id | ||
resource "azurerm_role_assignment" "acr_pull_frontend" { | ||
scope = var.container_registry_id | ||
role_definition_name = "acrpull" | ||
principal_id = azurerm_user_assigned_identity.frontend.principal_id | ||
} | ||
|
||
|
||
resource "azurerm_role_assignment" "user_key_vault" { | ||
scope = var.key_vault_id | ||
role_definition_name = "Key Vault Secrets User" | ||
principal_id = azurerm_user_assigned_identity.imo_app_vault.principal_id | ||
principal_id = azurerm_user_assigned_identity.backend.principal_id | ||
} | ||
|
||
resource "azurerm_role_assignment" "admin_key_vault" { | ||
scope = var.resource_group_id | ||
role_definition_name = "Key Vault Administrator" | ||
principal_id = var.azure_current_object_id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.