azure logo
Azure Classic v5.38.0, Mar 21 23

azure.monitoring.LogzTagRule

Manages a logz Tag Rule.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleLogzMonitor = new Azure.Monitoring.LogzMonitor("exampleLogzMonitor", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
        Plan = new Azure.Monitoring.Inputs.LogzMonitorPlanArgs
        {
            BillingCycle = "MONTHLY",
            EffectiveDate = "2022-06-06T00:00:00Z",
            UsageType = "COMMITTED",
        },
        User = new Azure.Monitoring.Inputs.LogzMonitorUserArgs
        {
            Email = "user@example.com",
            FirstName = "Example",
            LastName = "User",
            PhoneNumber = "+12313803556",
        },
    });

    var exampleLogzTagRule = new Azure.Monitoring.LogzTagRule("exampleLogzTagRule", new()
    {
        LogzMonitorId = exampleLogzMonitor.Id,
        TagFilters = new[]
        {
            new Azure.Monitoring.Inputs.LogzTagRuleTagFilterArgs
            {
                Name = "name1",
                Action = "Include",
                Value = "value1",
            },
            new Azure.Monitoring.Inputs.LogzTagRuleTagFilterArgs
            {
                Name = "name2",
                Action = "Exclude",
                Value = "value2",
            },
        },
        SendAadLogs = true,
        SendActivityLogs = true,
        SendSubscriptionLogs = true,
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleLogzMonitor, err := monitoring.NewLogzMonitor(ctx, "exampleLogzMonitor", &monitoring.LogzMonitorArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
			Plan: &monitoring.LogzMonitorPlanArgs{
				BillingCycle:  pulumi.String("MONTHLY"),
				EffectiveDate: pulumi.String("2022-06-06T00:00:00Z"),
				UsageType:     pulumi.String("COMMITTED"),
			},
			User: &monitoring.LogzMonitorUserArgs{
				Email:       pulumi.String("user@example.com"),
				FirstName:   pulumi.String("Example"),
				LastName:    pulumi.String("User"),
				PhoneNumber: pulumi.String("+12313803556"),
			},
		})
		if err != nil {
			return err
		}
		_, err = monitoring.NewLogzTagRule(ctx, "exampleLogzTagRule", &monitoring.LogzTagRuleArgs{
			LogzMonitorId: exampleLogzMonitor.ID(),
			TagFilters: monitoring.LogzTagRuleTagFilterArray{
				&monitoring.LogzTagRuleTagFilterArgs{
					Name:   pulumi.String("name1"),
					Action: pulumi.String("Include"),
					Value:  pulumi.String("value1"),
				},
				&monitoring.LogzTagRuleTagFilterArgs{
					Name:   pulumi.String("name2"),
					Action: pulumi.String("Exclude"),
					Value:  pulumi.String("value2"),
				},
			},
			SendAadLogs:          pulumi.Bool(true),
			SendActivityLogs:     pulumi.Bool(true),
			SendSubscriptionLogs: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.monitoring.LogzMonitor;
import com.pulumi.azure.monitoring.LogzMonitorArgs;
import com.pulumi.azure.monitoring.inputs.LogzMonitorPlanArgs;
import com.pulumi.azure.monitoring.inputs.LogzMonitorUserArgs;
import com.pulumi.azure.monitoring.LogzTagRule;
import com.pulumi.azure.monitoring.LogzTagRuleArgs;
import com.pulumi.azure.monitoring.inputs.LogzTagRuleTagFilterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleLogzMonitor = new LogzMonitor("exampleLogzMonitor", LogzMonitorArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .plan(LogzMonitorPlanArgs.builder()
                .billingCycle("MONTHLY")
                .effectiveDate("2022-06-06T00:00:00Z")
                .usageType("COMMITTED")
                .build())
            .user(LogzMonitorUserArgs.builder()
                .email("user@example.com")
                .firstName("Example")
                .lastName("User")
                .phoneNumber("+12313803556")
                .build())
            .build());

        var exampleLogzTagRule = new LogzTagRule("exampleLogzTagRule", LogzTagRuleArgs.builder()        
            .logzMonitorId(exampleLogzMonitor.id())
            .tagFilters(            
                LogzTagRuleTagFilterArgs.builder()
                    .name("name1")
                    .action("Include")
                    .value("value1")
                    .build(),
                LogzTagRuleTagFilterArgs.builder()
                    .name("name2")
                    .action("Exclude")
                    .value("value2")
                    .build())
            .sendAadLogs(true)
            .sendActivityLogs(true)
            .sendSubscriptionLogs(true)
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_logz_monitor = azure.monitoring.LogzMonitor("exampleLogzMonitor",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    plan=azure.monitoring.LogzMonitorPlanArgs(
        billing_cycle="MONTHLY",
        effective_date="2022-06-06T00:00:00Z",
        usage_type="COMMITTED",
    ),
    user=azure.monitoring.LogzMonitorUserArgs(
        email="user@example.com",
        first_name="Example",
        last_name="User",
        phone_number="+12313803556",
    ))
example_logz_tag_rule = azure.monitoring.LogzTagRule("exampleLogzTagRule",
    logz_monitor_id=example_logz_monitor.id,
    tag_filters=[
        azure.monitoring.LogzTagRuleTagFilterArgs(
            name="name1",
            action="Include",
            value="value1",
        ),
        azure.monitoring.LogzTagRuleTagFilterArgs(
            name="name2",
            action="Exclude",
            value="value2",
        ),
    ],
    send_aad_logs=True,
    send_activity_logs=True,
    send_subscription_logs=True)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleLogzMonitor = new azure.monitoring.LogzMonitor("exampleLogzMonitor", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    plan: {
        billingCycle: "MONTHLY",
        effectiveDate: "2022-06-06T00:00:00Z",
        usageType: "COMMITTED",
    },
    user: {
        email: "user@example.com",
        firstName: "Example",
        lastName: "User",
        phoneNumber: "+12313803556",
    },
});
const exampleLogzTagRule = new azure.monitoring.LogzTagRule("exampleLogzTagRule", {
    logzMonitorId: exampleLogzMonitor.id,
    tagFilters: [
        {
            name: "name1",
            action: "Include",
            value: "value1",
        },
        {
            name: "name2",
            action: "Exclude",
            value: "value2",
        },
    ],
    sendAadLogs: true,
    sendActivityLogs: true,
    sendSubscriptionLogs: true,
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleLogzMonitor:
    type: azure:monitoring:LogzMonitor
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      plan:
        billingCycle: MONTHLY
        effectiveDate: 2022-06-06T00:00:00Z
        usageType: COMMITTED
      user:
        email: user@example.com
        firstName: Example
        lastName: User
        phoneNumber: '+12313803556'
  exampleLogzTagRule:
    type: azure:monitoring:LogzTagRule
    properties:
      logzMonitorId: ${exampleLogzMonitor.id}
      tagFilters:
        - name: name1
          action: Include
          value: value1
        - name: name2
          action: Exclude
          value: value2
      sendAadLogs: true
      sendActivityLogs: true
      sendSubscriptionLogs: true

Create LogzTagRule Resource

new LogzTagRule(name: string, args: LogzTagRuleArgs, opts?: CustomResourceOptions);
@overload
def LogzTagRule(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                logz_monitor_id: Optional[str] = None,
                send_aad_logs: Optional[bool] = None,
                send_activity_logs: Optional[bool] = None,
                send_subscription_logs: Optional[bool] = None,
                tag_filters: Optional[Sequence[LogzTagRuleTagFilterArgs]] = None)
@overload
def LogzTagRule(resource_name: str,
                args: LogzTagRuleArgs,
                opts: Optional[ResourceOptions] = None)
func NewLogzTagRule(ctx *Context, name string, args LogzTagRuleArgs, opts ...ResourceOption) (*LogzTagRule, error)
public LogzTagRule(string name, LogzTagRuleArgs args, CustomResourceOptions? opts = null)
public LogzTagRule(String name, LogzTagRuleArgs args)
public LogzTagRule(String name, LogzTagRuleArgs args, CustomResourceOptions options)
type: azure:monitoring:LogzTagRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args LogzTagRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args LogzTagRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args LogzTagRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args LogzTagRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args LogzTagRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

LogzTagRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The LogzTagRule resource accepts the following input properties:

LogzMonitorId string

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

SendAadLogs bool

Whether AAD logs should be sent to the Monitor resource?

SendActivityLogs bool

Whether activity logs from Azure resources should be sent to the Monitor resource?

SendSubscriptionLogs bool

Whether subscription logs should be sent to the Monitor resource?

TagFilters List<LogzTagRuleTagFilterArgs>

One or more (up to 10) tag_filter blocks as defined below.

LogzMonitorId string

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

SendAadLogs bool

Whether AAD logs should be sent to the Monitor resource?

SendActivityLogs bool

Whether activity logs from Azure resources should be sent to the Monitor resource?

SendSubscriptionLogs bool

Whether subscription logs should be sent to the Monitor resource?

TagFilters []LogzTagRuleTagFilterArgs

One or more (up to 10) tag_filter blocks as defined below.

logzMonitorId String

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

sendAadLogs Boolean

Whether AAD logs should be sent to the Monitor resource?

sendActivityLogs Boolean

Whether activity logs from Azure resources should be sent to the Monitor resource?

sendSubscriptionLogs Boolean

Whether subscription logs should be sent to the Monitor resource?

tagFilters List<LogzTagRuleTagFilterArgs>

One or more (up to 10) tag_filter blocks as defined below.

logzMonitorId string

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

sendAadLogs boolean

Whether AAD logs should be sent to the Monitor resource?

sendActivityLogs boolean

Whether activity logs from Azure resources should be sent to the Monitor resource?

sendSubscriptionLogs boolean

Whether subscription logs should be sent to the Monitor resource?

tagFilters LogzTagRuleTagFilterArgs[]

One or more (up to 10) tag_filter blocks as defined below.

logz_monitor_id str

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

send_aad_logs bool

Whether AAD logs should be sent to the Monitor resource?

send_activity_logs bool

Whether activity logs from Azure resources should be sent to the Monitor resource?

send_subscription_logs bool

Whether subscription logs should be sent to the Monitor resource?

tag_filters Sequence[LogzTagRuleTagFilterArgs]

One or more (up to 10) tag_filter blocks as defined below.

logzMonitorId String

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

sendAadLogs Boolean

Whether AAD logs should be sent to the Monitor resource?

sendActivityLogs Boolean

Whether activity logs from Azure resources should be sent to the Monitor resource?

sendSubscriptionLogs Boolean

Whether subscription logs should be sent to the Monitor resource?

tagFilters List<Property Map>

One or more (up to 10) tag_filter blocks as defined below.

Outputs

All input properties are implicitly available as output properties. Additionally, the LogzTagRule resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing LogzTagRule Resource

Get an existing LogzTagRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: LogzTagRuleState, opts?: CustomResourceOptions): LogzTagRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        logz_monitor_id: Optional[str] = None,
        send_aad_logs: Optional[bool] = None,
        send_activity_logs: Optional[bool] = None,
        send_subscription_logs: Optional[bool] = None,
        tag_filters: Optional[Sequence[LogzTagRuleTagFilterArgs]] = None) -> LogzTagRule
func GetLogzTagRule(ctx *Context, name string, id IDInput, state *LogzTagRuleState, opts ...ResourceOption) (*LogzTagRule, error)
public static LogzTagRule Get(string name, Input<string> id, LogzTagRuleState? state, CustomResourceOptions? opts = null)
public static LogzTagRule get(String name, Output<String> id, LogzTagRuleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
LogzMonitorId string

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

SendAadLogs bool

Whether AAD logs should be sent to the Monitor resource?

SendActivityLogs bool

Whether activity logs from Azure resources should be sent to the Monitor resource?

SendSubscriptionLogs bool

Whether subscription logs should be sent to the Monitor resource?

TagFilters List<LogzTagRuleTagFilterArgs>

One or more (up to 10) tag_filter blocks as defined below.

LogzMonitorId string

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

SendAadLogs bool

Whether AAD logs should be sent to the Monitor resource?

SendActivityLogs bool

Whether activity logs from Azure resources should be sent to the Monitor resource?

SendSubscriptionLogs bool

Whether subscription logs should be sent to the Monitor resource?

TagFilters []LogzTagRuleTagFilterArgs

One or more (up to 10) tag_filter blocks as defined below.

logzMonitorId String

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

sendAadLogs Boolean

Whether AAD logs should be sent to the Monitor resource?

sendActivityLogs Boolean

Whether activity logs from Azure resources should be sent to the Monitor resource?

sendSubscriptionLogs Boolean

Whether subscription logs should be sent to the Monitor resource?

tagFilters List<LogzTagRuleTagFilterArgs>

One or more (up to 10) tag_filter blocks as defined below.

logzMonitorId string

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

sendAadLogs boolean

Whether AAD logs should be sent to the Monitor resource?

sendActivityLogs boolean

Whether activity logs from Azure resources should be sent to the Monitor resource?

sendSubscriptionLogs boolean

Whether subscription logs should be sent to the Monitor resource?

tagFilters LogzTagRuleTagFilterArgs[]

One or more (up to 10) tag_filter blocks as defined below.

logz_monitor_id str

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

send_aad_logs bool

Whether AAD logs should be sent to the Monitor resource?

send_activity_logs bool

Whether activity logs from Azure resources should be sent to the Monitor resource?

send_subscription_logs bool

Whether subscription logs should be sent to the Monitor resource?

tag_filters Sequence[LogzTagRuleTagFilterArgs]

One or more (up to 10) tag_filter blocks as defined below.

logzMonitorId String

The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.

sendAadLogs Boolean

Whether AAD logs should be sent to the Monitor resource?

sendActivityLogs Boolean

Whether activity logs from Azure resources should be sent to the Monitor resource?

sendSubscriptionLogs Boolean

Whether subscription logs should be sent to the Monitor resource?

tagFilters List<Property Map>

One or more (up to 10) tag_filter blocks as defined below.

Supporting Types

LogzTagRuleTagFilter

Action string

The action for a filtering tag. Possible values are Include and Exclude is allowed. Note that the Exclude takes priority over the Include.

Name string

The name of this tag_filter.

Value string

The value of this tag_filter.

Action string

The action for a filtering tag. Possible values are Include and Exclude is allowed. Note that the Exclude takes priority over the Include.

Name string

The name of this tag_filter.

Value string

The value of this tag_filter.

action String

The action for a filtering tag. Possible values are Include and Exclude is allowed. Note that the Exclude takes priority over the Include.

name String

The name of this tag_filter.

value String

The value of this tag_filter.

action string

The action for a filtering tag. Possible values are Include and Exclude is allowed. Note that the Exclude takes priority over the Include.

name string

The name of this tag_filter.

value string

The value of this tag_filter.

action str

The action for a filtering tag. Possible values are Include and Exclude is allowed. Note that the Exclude takes priority over the Include.

name str

The name of this tag_filter.

value str

The value of this tag_filter.

action String

The action for a filtering tag. Possible values are Include and Exclude is allowed. Note that the Exclude takes priority over the Include.

name String

The name of this tag_filter.

value String

The value of this tag_filter.

Import

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

 $ pulumi import azure:monitoring/logzTagRule:LogzTagRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Logz/monitors/monitor1/tagRules/ruleSet1

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.