Skip to content

azurermLogzTagRule

Manages a logz Tag Rule.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-logz",
  }
);
const azurermLogzMonitorExample = new azurerm.logzMonitor.LogzMonitor(
  this,
  "example_1",
  {
    location: azurermResourceGroupExample.location,
    name: "example-monitor",
    plan: [
      {
        billing_cycle: "MONTHLY",
        effective_date: "2022-06-06T00:00:00Z",
        usage_type: "COMMITTED",
      },
    ],
    resource_group_name: azurermResourceGroupExample.name,
    user: [
      {
        email: "user@example.com",
        first_name: "Example",
        last_name: "User",
        phone_number: "+12313803556",
      },
    ],
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLogzMonitorExample.overrideLogicalId("example");
const azurermLogzTagRuleExample = new azurerm.logzTagRule.LogzTagRule(
  this,
  "example_2",
  {
    logz_monitor_id: azurermLogzMonitorExample.id,
    send_aad_logs: true,
    send_activity_logs: true,
    send_subscription_logs: true,
    tag_filter: [
      {
        action: "Include",
        name: "name1",
        value: "value1",
      },
      {
        action: "Exclude",
        name: "name2",
        value: "value2",
      },
    ],
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLogzTagRuleExample.overrideLogicalId("example");

Arguments Reference

The following arguments are supported:

  • logzMonitorId - (Required) The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

  • tagFilter - (Optional) One or more (up to 10) tagFilter blocks as defined below.

  • sendAadLogs - (Optional) Whether AAD logs should be sent to the Monitor resource?

  • sendActivityLogs - (Optional) Whether activity logs from Azure resources should be sent to the Monitor resource?

  • sendSubscriptionLogs - (Optional) Whether subscription logs should be sent to the Monitor resource?


An tagFilter block exports the following:

  • name - (Required) The name of this tagFilter.

  • action - (Required) The action for a filtering tag. Possible values are include and exclude is allowed. Note that the exclude takes priority over the include.

  • value - (Optional) The value of this tagFilter.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the logz Tag Rule.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the logz Tag Rule.
  • read - (Defaults to 5 minutes) Used when retrieving the logz Tag Rule.
  • update - (Defaults to 30 minutes) Used when updating the logz Tag Rule.
  • delete - (Defaults to 30 minutes) Used when deleting the logz Tag Rule.

Import

logz Tag Rules can be imported using the resourceId, e.g.

terraform import azurerm_logz_tag_rule.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Logz/monitors/monitor1/tagRules/ruleSet1