Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-taylor committed Mar 12, 2024
1 parent fb29999 commit a34bcb9
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/modules/settings/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
data "azurerm_client_config" "core" {}

locals {
umi_name = "id-identity"
umi_resource_group_name = "rg-identity"
}

resource "azurerm_resource_group" "example" {
name = local.umi_resource_group_name
location = "East US"
}

resource "azurerm_user_assigned_identity" "example" {
location = azurerm_resource_group.example.location
name = local.umi_name
resource_group_name = azurerm_resource_group.example.name
}
3 changes: 3 additions & 0 deletions tests/modules/settings/settings.core.tf
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,8 @@ locals {
"northcentralus",
"southcentralus",
]
subscription_id = data.azurerm_client_config.core.subscription_id
umi_resource_group_name = local.umi_resource_group_name
umi_name = local.umi_name
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "Deploy-Log-Analytics",
"type": "Microsoft.Authorization/policyAssignments",
"apiVersion": "2019-09-01",
"properties": {
"description": "Deploy-Log-Analytics.",
"displayName": "Deploy-Log-Analytics",
"notScopes": [],
"parameters": {
"workspaceName": {
"value": "${root_scope_id}-la"
},
"automationAccountName": {
"value": "${root_scope_id}-automation"
},
"workspaceRegion": {
"value": "${default_location}"
},
"automationRegion": {
"value": "${default_location}"
},
"dataRetention": {
"value": "30"
},
"sku": {
"value": "pergb2018"
},
"rgName": {
"value": "${root_scope_id}-mgmt"
},
"effect": {
"value": "DeployIfNotExists"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/8e3e61b3-0b32-22d5-4edf-55f87fdb5955",
"scope": "${current_scope_resource_id}",
"enforcementMode": "DoNotEnforce"
},
"location": "${default_location}",
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/${subscription_id}/resourceGroups/${umi_resource_group_name}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/${umi_name}": {}
}
}
}

0 comments on commit a34bcb9

Please sign in to comment.