Skip to content

Commit

Permalink
chore: Bump providers and move resources (#157)
Browse files Browse the repository at this point in the history
* chore: Bump providers

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

* move resources

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

* move resources

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>

---------

Signed-off-by: Jorge Turrado <jorge.turrado@scrm.lidl>
  • Loading branch information
JorTurFer authored Jul 29, 2024
1 parent 82a81b7 commit 5600c83
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 99 deletions.
177 changes: 90 additions & 87 deletions terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 28 additions & 4 deletions terraform/modules/azure/aks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ resource "azurerm_resource_group_template_deployment" "dce" {
"dce_name" = {
value = local.dce_name
}
"location" = {
value = var.location
}
})
template_content = <<TEMPLATE
{
Expand All @@ -106,14 +109,17 @@ resource "azurerm_resource_group_template_deployment" "dce" {
"parameters": {
"dce_name": {
"type": "String"
},
"location": {
"type": "String"
}
},
"resources": [
{
"type": "Microsoft.Insights/dataCollectionEndpoints",
"apiVersion": "2021-09-01-preview",
"name": "[parameters('dce_name')]",
"location": "[resourceGroup().location]",
"location": "[parameters('location')]",
"kind": "Linux",
"properties": {}
}
Expand Down Expand Up @@ -144,6 +150,9 @@ resource "azurerm_resource_group_template_deployment" "dcr" {
"azure_monitor_workspace_id" = {
value = var.azure_monitor_workspace_id
}
"location" = {
value = var.location
}
})
template_content = <<TEMPLATE
{
Expand All @@ -158,14 +167,17 @@ resource "azurerm_resource_group_template_deployment" "dcr" {
},
"azure_monitor_workspace_id": {
"type": "String"
},
"location": {
"type": "String"
}
},
"resources": [
{
"type": "Microsoft.Insights/dataCollectionRules",
"apiVersion": "2021-09-01-preview",
"name": "[parameters('dcr_name')]",
"location": "[resourceGroup().location]",
"location": "[parameters('location')]",
"kind": "Linux",
"properties": {
"dataCollectionEndpointId": "[resourceId('Microsoft.Insights/dataCollectionEndpoints/', parameters('dce_name'))]",
Expand Down Expand Up @@ -222,6 +234,9 @@ resource "azurerm_resource_group_template_deployment" "dcra" {
"cluster_name" = {
value = azurerm_kubernetes_cluster.aks.name
}
"location" = {
value = var.location
}
})
template_content = <<TEMPLATE
{
Expand All @@ -236,14 +251,17 @@ resource "azurerm_resource_group_template_deployment" "dcra" {
},
"cluster_name": {
"type": "String"
},
"location": {
"type": "String"
}
},
"resources": [
{
"type": "Microsoft.ContainerService/managedClusters/providers/dataCollectionRuleAssociations",
"name": "[concat(parameters('cluster_name'),'/microsoft.insights/', parameters('dcra_name'))]",
"apiVersion": "2021-09-01-preview",
"location": "[resourceGroup().location]",
"location": "[parameters('location')]",
"properties": {
"description": "Association of data collection rule. Deleting this association will break the data collection for this AKS Cluster.",
"dataCollectionRuleId": "[resourceId('Microsoft.Insights/dataCollectionRules', parameters('dcr_name'))]"
Expand Down Expand Up @@ -272,6 +290,9 @@ resource "azurerm_resource_group_template_deployment" "rules" {
"cluster_name" = {
value = azurerm_kubernetes_cluster.aks.name
}
"location" = {
value = var.location
}
})
template_content = <<TEMPLATE
{
Expand All @@ -286,14 +307,17 @@ resource "azurerm_resource_group_template_deployment" "rules" {
},
"cluster_name": {
"type": "String"
},
"location": {
"type": "String"
}
},
"resources": [
{
"type": "Microsoft.AlertsManagement/prometheusRuleGroups",
"apiVersion": "2021-07-22-preview",
"name": "[parameters('rule_group_name')]",
"location": "[resourceGroup().location]",
"location": "[parameters('location')]",
"properties": {
"enabled": true,
"clusterName": "[parameters('cluster_name')]",
Expand Down
10 changes: 8 additions & 2 deletions terraform/modules/azure/monitor-stack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,28 @@ resource "azurerm_resource_group_template_deployment" "azure_monitor_workspace"
"workspace_name" = {
value = local.azure_monitor_workspace_name
}
"location" = {
value = var.location
}
})
template_content = <<TEMPLATE
{
"$schema": "http://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace_name": {
"type": "String"
"type": "String"
},
"location": {
"type": "String"
}
},
"resources": [
{
"type": "microsoft.monitor/accounts",
"apiVersion": "2021-06-03-preview",
"name": "[parameters('workspace_name')]",
"location": "[resourceGroup().location]"
"location": "[parameters('location')]"
}
],
"outputs": {
Expand Down
Loading

0 comments on commit 5600c83

Please sign in to comment.