generated from pagopa-archive/template-devops-azure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Migrate-selfcare-to-managed-identity (#293)
- Loading branch information
1 parent
84f42aa
commit 9644c7c
Showing
22 changed files
with
277 additions
and
359 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
data "azurerm_client_config" "current" {} | ||
|
||
data "azurerm_subscriptions" "dev" { | ||
display_name_prefix = local.dev_subscription_name | ||
} | ||
|
||
data "azurerm_subscriptions" "uat" { | ||
display_name_prefix = local.uat_subscription_name | ||
} | ||
data "azurerm_subscriptions" "prod" { | ||
display_name_prefix = local.prod_subscription_name | ||
} | ||
|
||
|
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
97 changes: 97 additions & 0 deletions
97
azure-devops/selfcare/03_service_connections_appinsights.tf
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# | ||
# ⛩ Service connection 2 🔐 KV@DEV 🛑 | ||
# | ||
#tfsec:ignore:GEN003 | ||
module "DEV-APPINSIGHTS-SERVICE-CONN" { | ||
source = "git::https://github.com/pagopa/azuredevops-tf-modules.git//azuredevops_serviceendpoint_federated?ref=v4.1.5" | ||
providers = { | ||
azurerm = azurerm.dev | ||
} | ||
|
||
project_id = data.azuredevops_project.project.id | ||
name = "${local.prefix}-d-${local.domain}-appinsights" | ||
tenant_id = data.azurerm_client_config.current.tenant_id | ||
subscription_id = data.azurerm_subscriptions.dev.subscriptions[0].subscription_id | ||
subscription_name = var.dev_subscription_name | ||
location = var.location | ||
resource_group_name = local.dev_identity_rg_name | ||
} | ||
|
||
data "azurerm_application_insights" "application_insights_dev" { | ||
provider = azurerm.dev | ||
name = local.dev_appinsights_name | ||
resource_group_name = local.dev_appinsights_resource_group | ||
} | ||
|
||
resource "azurerm_role_assignment" "appinsights_component_contributor_dev" { | ||
provider = azurerm.dev | ||
scope = data.azurerm_application_insights.application_insights_dev.id | ||
role_definition_name = "Application Insights Component Contributor" | ||
principal_id = module.DEV-APPINSIGHTS-SERVICE-CONN.service_principal_object_id | ||
} | ||
|
||
# | ||
# ⛩ Service connection 2 🔐 KV@UAT 🛑 | ||
# | ||
#tfsec:ignore:GEN003 | ||
module "UAT-APPINSIGHTS-SERVICE-CONN" { | ||
source = "git::https://github.com/pagopa/azuredevops-tf-modules.git//azuredevops_serviceendpoint_federated?ref=v4.1.5" | ||
providers = { | ||
azurerm = azurerm.uat | ||
} | ||
|
||
project_id = data.azuredevops_project.project.id | ||
name = "${local.prefix}-u-${local.domain}-appinsights" | ||
tenant_id = data.azurerm_client_config.current.tenant_id | ||
subscription_id = data.azurerm_subscriptions.uat.subscriptions[0].subscription_id | ||
subscription_name = var.uat_subscription_name | ||
|
||
location = var.location | ||
resource_group_name = local.uat_identity_rg_name | ||
} | ||
|
||
data "azurerm_application_insights" "application_insights_uat" { | ||
provider = azurerm.uat | ||
name = local.uat_appinsights_name | ||
resource_group_name = local.uat_appinsights_resource_group | ||
} | ||
|
||
resource "azurerm_role_assignment" "appinsights_component_contributor_uat" { | ||
provider = azurerm.uat | ||
scope = data.azurerm_application_insights.application_insights_uat.id | ||
role_definition_name = "Application Insights Component Contributor" | ||
principal_id = module.UAT-APPINSIGHTS-SERVICE-CONN.service_principal_object_id | ||
} | ||
|
||
# | ||
# ⛩ Service connection 2 🔐 KV@PROD 🛑 | ||
# | ||
#tfsec:ignore:GEN003 | ||
module "PROD-APPINSIGHTS-SERVICE-CONN" { | ||
source = "git::https://github.com/pagopa/azuredevops-tf-modules.git//azuredevops_serviceendpoint_federated?ref=v4.1.5" | ||
providers = { | ||
azurerm = azurerm.prod | ||
} | ||
|
||
project_id = data.azuredevops_project.project.id | ||
name = "${local.prefix}-p-${local.domain}-appinsights" | ||
tenant_id = data.azurerm_client_config.current.tenant_id | ||
subscription_id = data.azurerm_subscriptions.prod.subscriptions[0].subscription_id | ||
subscription_name = var.prod_subscription_name | ||
|
||
location = var.location | ||
resource_group_name = local.prod_identity_rg_name | ||
} | ||
|
||
data "azurerm_application_insights" "application_insights_prod" { | ||
provider = azurerm.prod | ||
name = local.prod_appinsights_name | ||
resource_group_name = local.prod_appinsights_resource_group | ||
} | ||
|
||
resource "azurerm_role_assignment" "appinsights_component_contributor_prod" { | ||
provider = azurerm.prod | ||
scope = data.azurerm_application_insights.application_insights_prod.id | ||
role_definition_name = "Application Insights Component Contributor" | ||
principal_id = module.PROD-APPINSIGHTS-SERVICE-CONN.service_principal_object_id | ||
} |
35 changes: 0 additions & 35 deletions
35
azure-devops/selfcare/03_service_connections_appinsights_dev.tf
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
azure-devops/selfcare/03_service_connections_appinsights_prod.tf
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
azure-devops/selfcare/03_service_connections_appinsights_uat.tf
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.