Skip to content

Azure/terraform-azurerm-avm-ptn-alz-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Landing Zones Management Resources AVM Module

This module deploys the management resource for Azure Landings Zones.

Features

  • Deployment of Log Analytics Workspace.
  • Opitional deployment of Azure Automation Account.
  • Optional deployment of Azure Resource Group.
  • Customizable Log Analytics Solutions.
  • Optional deployment of Data Collections Rules.
  • Optional deployment of User Assigned Managed Identity.

Example

module "avm-ptn-alz-management" {
  source  = "Azure/avm-ptn-alz-management/azurerm"
  version = "<version>" # change this to your desired version, https://www.terraform.io/language/expressions/version-constraints

  automation_account_name      = "aa-prod-eus-001"
  location                     = "eastus"
  log_analytics_workspace_name = "law-prod-eus-001"
  resource_group_name          = "rg-management-eus-001"
}

Requirements

The following requirements are needed by this module:

Resources

The following resources are used by this module:

Required Inputs

The following input variables are required:

Description: The name of the Azure Automation Account to create.

Type: string

Description: The Azure region where the resources will be deployed.

Type: string

Description: The name of the Log Analytics Workspace to create.

Type: string

Description: The name of the Azure Resource Group where the resources will be created.

Type: string

Optional Inputs

The following input variables are optional (have default values):

Description: The encryption configuration for the Azure Automation Account.

Type:

object({
    key_vault_key_id          = string
    user_assigned_identity_id = optional(string, null)
  })

Default: null

Description: The identity to assign to the Azure Automation Account.

Type:

object({
    type         = string
    identity_ids = optional(set(string), null)
  })

Default: null

Description: Whether or not local authentication is enabled for the Azure Automation Account.

Type: bool

Default: true

Description: The Azure region of the Azure Automation Account to deploy. This supports overriding the location variable in specific cases.

Type: string

Default: null

Description: Whether or not public network access is enabled for the Azure Automation Account.

Type: bool

Default: true

Description: The name of the SKU for the Azure Automation Account to create.

Type: string

Default: "Basic"

Description: Enables customisation of the data collection rules for Azure Monitor.
This is an object with attributes pertaining to the three DCRs that are created by this module.

Each object has the following attributes:

  • enabled (Optional) - Whether or not to create the data collection rule. Defaults to true.
  • name (Required) - The name of the data collection rule. For the default values, see the default variable value.
  • location (Optional) - The Azure region of the data collection rule. Defaults to the value of the location variable.
  • tags (Optional) - A map of tags to apply to the data collection rule. Defaults to null.

The defender_sql object has an additional attribute:

  • enable_collection_of_sql_queries_for_security_research (Optional) - Whether or not to enable collection of SQL queries for security research. Defaults to false.

Type:

object({
    change_tracking = object({
      enabled  = optional(bool, true)
      name     = string
      location = optional(string, null)
      tags     = optional(map(string), null)
    })
    vm_insights = object({
      enabled  = optional(bool, true)
      name     = string
      location = optional(string, null)
      tags     = optional(map(string), null)
    })
    defender_sql = object({
      enabled                                                = optional(bool, true)
      name                                                   = string
      location                                               = optional(string, null)
      tags                                                   = optional(map(string), null)
      enable_collection_of_sql_queries_for_security_research = optional(bool, false)
    })
  })

Default:

{
  "change_tracking": {
    "name": "dcr-change-tracking"
  },
  "defender_sql": {
    "name": "dcr-defender-sql"
  },
  "vm_insights": {
    "name": "dcr-vm-insights"
  }
}

Description: This variable controls whether or not telemetry is enabled for the module.
For more information see https://aka.ms/avm/telemetryinfo.
If it is set to false, then no telemetry will be collected.

Type: bool

Default: true

Description: A boolean flag to determine whether to deploy the Azure Automation Account linked to the Log Analytics Workspace or not.

Type: bool

Default: false

Description: The Log Analytics Solution Plans to create.
Do not add the SecurityInsights solution plan here, this deployment method is deprecated. Instead refer to sentinel_onboarding variable.

The value of this variable is a list of objects with the following attributes:

  • product (Required) - The product name of the solution plan, e.g. OMSGallery/ContainerInsights.
  • publisher (Optional) - The publisher name of the solution plan, e.g. Microsoft. Defaults to Microsoft.

Type:

list(object({
    product   = string
    publisher = optional(string, "Microsoft")
  }))

Default:

[
  {
    "product": "OMSGallery/ContainerInsights",
    "publisher": "Microsoft"
  },
  {
    "product": "OMSGallery/VMInsights",
    "publisher": "Microsoft"
  }
]

Description: Whether or not to allow resource-only permissions for the Log Analytics Workspace.

Type: bool

Default: true

Description: Whether or not to force the use of customer-managed keys for query in the Log Analytics Workspace.

Type: bool

Default: null

Description: The daily ingestion quota in GB for the Log Analytics Workspace.

Type: number

Default: null

Description: Whether or not internet ingestion is enabled for the Log Analytics Workspace.

Type: bool

Default: true

Description: Whether or not internet query is enabled for the Log Analytics Workspace.

Type: bool

Default: true

Description: Whether or not local authentication is disabled for the Log Analytics Workspace.

Type: bool

Default: false

Description: The reservation capacity in GB per day for the Log Analytics Workspace.

Type: number

Default: null

Description: The number of days to retain data for the Log Analytics Workspace.

Type: number

Default: 30

Description: The SKU to use for the Log Analytics Workspace.

Type: string

Default: "PerGB2018"

Description: A boolean flag to determine whether to deploy the Azure Resource Group or not.

Type: bool

Default: true

Description: Enables customisation of the Sentinel onboarding. Set to null to disable.

This is an object with the following attributes:

  • name (Optional) - The name of the Sentinel onboarding object. Defaults to default.
  • customer_managed_key_enabled (Optional) - Whether or not to enable customer-managed keys for the Sentinel onboarding. Defaults to false.

Type:

object({
    name                         = optional(string, "default")
    customer_managed_key_enabled = optional(bool, false)
  })

Default: {}

Description: A map of tags to apply to the resources created.

Type: map(string)

Default: null

Description: A map of timeouts to apply to the creation and destruction of resources.
If using retry, the maximum elapsed retry time is governed by this value.

The object has attributes for each resource type, with the following optional attributes:

  • create - (Optional) The timeout for creating the resource. Defaults to 5m.
  • delete - (Optional) The timeout for deleting the resource. Defaults to 5m apart from data_collection_rule, where this is set to 10m.
  • update - (Optional) The timeout for updating the resource. Defaults to 5m.
  • read - (Optional) The timeout for reading the resource. Defaults to 5m.

Each time duration is parsed using this function: https://pkg.go.dev/time#ParseDuration.

Type:

object({
    sentinel_onboarding = optional(object({
      create = optional(string, "5m")
      delete = optional(string, "5m")
      update = optional(string, "5m")
      read   = optional(string, "5m")
      }), {}
    )
    data_collection_rule = optional(object({
      create = optional(string, "5m")
      delete = optional(string, "10m")
      update = optional(string, "5m")
      read   = optional(string, "5m")
      }), {}
    )
  })

Default: {}

Description: Enables customisation of the user assigned managed identities.

The value of this variable is an object with the following attributes:

  • ama (Required) - The user assigned managed identity for the Azure Monitor Agent.
    • enabled (Optional) - Whether or not to create the user assigned managed identity. Defaults to true.
    • name (Required) - The name of the user assigned managed identity, the variable default value is uami-ama.
    • location (Optional) - The Azure region of the user assigned managed identity. Defaults to the value of the location variable.
    • tags (Optional) - A map of tags to apply to the user assigned managed identity. Defaults to null.

Type:

object({
    ama = object({
      enabled  = optional(bool, true)
      name     = string
      location = optional(string, null)
      tags     = optional(map(string), null)
    })
  })

Default:

{
  "ama": {
    "name": "uami-ama"
  }
}

Outputs

The following outputs are exported:

Description: A curated output of the Azure Automation Account.

Description: Sensitive values for the Azure Automation Account.

Description: Data Collection Rule Resource Ids.

Description: A curated output of the Log Analytics Workspace.

Description: Sensitive values for the Log Analytics Workspace.

Description: A curated output of the Azure Resource Group.

Description: The resource ID of the Log Analytics Workspace.

Description: User assigned identity IDs.

Modules

No modules.

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.