This Overlay terraform module can create Diagnostic Settings on a given Azure resource and manage related parameters to be used in a SCCA compliant Network.
Since this module is built for both public and us government clouds. The environment variable defaults to public for Azure Cloud. When using this module with the Azure Government Cloud, you must set the environment variable to usgovernment. You will also need to set the azurerm provider environment variable to the proper cloud as well. This will ensure that the correct Azure Government Cloud endpoints are used. You will also need to set the location variable to a valid Azure Government Cloud location.
Example Usage for Azure Government Cloud:
provider "azurerm" {
environment = "usgovernment"
}
module "mod_ampls" {
source = "POps-Rox/tf-az-overlays-diagnostic-settings/azurerm"
version = "x.x.x"
location = "usgovvirginia"
environment = "usgovernment"
...
}
This module can be SCCA compliant and can be used in a SCCA compliant Network. Enable private endpoints and SCCA compliant network rules to make it SCCA compliant.
For more information, please read the SCCA documentation.
If you want to contribute to this repository, feel free to to contribute to our Terraform module.
More details are available in the CONTRIBUTING.md file.
This Terraform module is open-sourced software licensed under the MIT License.
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
module "mod_ampls" {
source = "POps-Rox/tf-az-overlays-diagnostic-settings/azurerm"
version = "x.x.x"
# Resource Group, location, VNet and Subnet details
location = var.location
deploy_environment = var.deploy_environment
environment = var.environment
org_name = var.org_name
resource_id = azurerm_key_vault.diagnostic-settings-kv.id
logs_destinations_ids = [azurerm_log_analytics_workspace.diagnostic-settings-log.id]
}
| Name | Version |
|---|---|
| terraform | >= 1.9 |
| popsrox-utils | ~> 1.0.4 |
| azurerm | ~> 3.116 |
| Name | Version |
|---|---|
| popsrox-utils | ~> 1.0.4 |
| azurerm | ~> 3.116 |
| Name | Source | Version |
|---|---|---|
| mod_azure_region_lookup | POps-Rox/overlays-azregions-lookup/azurerm | ~> 1.0.0 |
| Name | Type |
|---|---|
| azurerm_monitor_diagnostic_setting.main | resource |
| popsrox_resource_name.diagnostic_setting | data source |
| azurerm_monitor_diagnostic_categories.main | data source |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| custom_diagnostic_setting_name | The name of the custom diagnostic setting to create. If not set, the name will be generated using the org_name, workload_name, deploy_environment and environment variables. |
string |
null |
no |
| deploy_environment | Name of the workload's environment | string |
n/a | yes |
| environment | The Terraform backend environment e.g. public or usgovernment | string |
n/a | yes |
| excluded_log_categories | List of log categories to exclude. | list(string) |
[] |
no |
| location | Azure region in which instance will be hosted | string |
n/a | yes |
| log_analytics_destination_type | When set to 'Dedicated' logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table. | string |
"AzureDiagnostics" |
no |
| log_categories | List of log categories. Defaults to all available. | list(string) |
null |
no |
| logs_destinations_ids | List of destination resources IDs for logs diagnostic destination. Can be Storage Account, Log Analytics Workspace and Event Hub. No more than one of each can be set.If you want to use Azure EventHub as destination, you must provide a formatted string with both the EventHub Namespace authorization send ID and the EventHub name (name of the queue to use in the Namespace) separated by the | character. |
list(string) |
n/a | yes |
| metric_categories | List of metric categories. Defaults to all available. | list(string) |
null |
no |
| name_prefix | Optional prefix for the generated name | string |
"" |
no |
| name_suffix | Optional suffix for the generated name | string |
"" |
no |
| org_name | Name of the organization | string |
n/a | yes |
| resource_id | The ID of the resource on which activate the diagnostic settings. | string |
n/a | yes |
| use_location_short_name | Use short location name for resources naming (ie eastus -> eus). Default is true. If set to false, the full cli location name will be used. if custom naming is set, this variable will be ignored. | bool |
true |
no |
| use_naming | Use the Azure NoOps naming provider to generate default resource name. storage_account_custom_name override this if set. Legacy default name is used if this is set to false. |
bool |
true |
no |
No outputs.