1. Packages
  2. Azure Native v2
  3. API Docs
  4. logz
  5. MetricsSourceTagRule
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.logz.MetricsSourceTagRule

Explore with Pulumi AI

Capture metrics of Azure resources based on ARM tags. Azure REST API version: 2022-01-01-preview. Prior API version in Azure Native 1.x: 2022-01-01-preview.

Example Usage

MetricsSourceTagRules_CreateOrUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var metricsSourceTagRule = new AzureNative.Logz.MetricsSourceTagRule("metricsSourceTagRule", new()
    {
        MetricsSourceName = "MetricsSource1",
        MonitorName = "myMonitor",
        ResourceGroupName = "myResourceGroup",
        RuleSetName = "default",
    });

});
Copy
package main

import (
	logz "github.com/pulumi/pulumi-azure-native-sdk/logz/v2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := logz.NewMetricsSourceTagRule(ctx, "metricsSourceTagRule", &logz.MetricsSourceTagRuleArgs{
			MetricsSourceName: pulumi.String("MetricsSource1"),
			MonitorName:       pulumi.String("myMonitor"),
			ResourceGroupName: pulumi.String("myResourceGroup"),
			RuleSetName:       pulumi.String("default"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.logz.MetricsSourceTagRule;
import com.pulumi.azurenative.logz.MetricsSourceTagRuleArgs;
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 metricsSourceTagRule = new MetricsSourceTagRule("metricsSourceTagRule", MetricsSourceTagRuleArgs.builder()
            .metricsSourceName("MetricsSource1")
            .monitorName("myMonitor")
            .resourceGroupName("myResourceGroup")
            .ruleSetName("default")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const metricsSourceTagRule = new azure_native.logz.MetricsSourceTagRule("metricsSourceTagRule", {
    metricsSourceName: "MetricsSource1",
    monitorName: "myMonitor",
    resourceGroupName: "myResourceGroup",
    ruleSetName: "default",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

metrics_source_tag_rule = azure_native.logz.MetricsSourceTagRule("metricsSourceTagRule",
    metrics_source_name="MetricsSource1",
    monitor_name="myMonitor",
    resource_group_name="myResourceGroup",
    rule_set_name="default")
Copy
resources:
  metricsSourceTagRule:
    type: azure-native:logz:MetricsSourceTagRule
    properties:
      metricsSourceName: MetricsSource1
      monitorName: myMonitor
      resourceGroupName: myResourceGroup
      ruleSetName: default
Copy

Create MetricsSourceTagRule Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new MetricsSourceTagRule(name: string, args: MetricsSourceTagRuleArgs, opts?: CustomResourceOptions);
@overload
def MetricsSourceTagRule(resource_name: str,
                         args: MetricsSourceTagRuleArgs,
                         opts: Optional[ResourceOptions] = None)

@overload
def MetricsSourceTagRule(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         metrics_source_name: Optional[str] = None,
                         monitor_name: Optional[str] = None,
                         resource_group_name: Optional[str] = None,
                         properties: Optional[MetricsTagRulesPropertiesArgs] = None,
                         rule_set_name: Optional[str] = None)
func NewMetricsSourceTagRule(ctx *Context, name string, args MetricsSourceTagRuleArgs, opts ...ResourceOption) (*MetricsSourceTagRule, error)
public MetricsSourceTagRule(string name, MetricsSourceTagRuleArgs args, CustomResourceOptions? opts = null)
public MetricsSourceTagRule(String name, MetricsSourceTagRuleArgs args)
public MetricsSourceTagRule(String name, MetricsSourceTagRuleArgs args, CustomResourceOptions options)
type: azure-native:logz:MetricsSourceTagRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

The following reference example uses placeholder values for all input properties.

var metricsSourceTagRuleResource = new AzureNative.Logz.MetricsSourceTagRule("metricsSourceTagRuleResource", new()
{
    MetricsSourceName = "string",
    MonitorName = "string",
    ResourceGroupName = "string",
    Properties = 
    {
        { "metricRules", new[]
        {
            
            {
                { "filteringTags", new[]
                {
                    
                    {
                        { "action", "string" },
                        { "name", "string" },
                        { "value", "string" },
                    },
                } },
                { "subscriptionId", "string" },
            },
        } },
        { "sendMetrics", false },
    },
    RuleSetName = "string",
});
Copy
example, err := logz.NewMetricsSourceTagRule(ctx, "metricsSourceTagRuleResource", &logz.MetricsSourceTagRuleArgs{
	MetricsSourceName: "string",
	MonitorName:       "string",
	ResourceGroupName: "string",
	Properties: map[string]interface{}{
		"metricRules": []map[string]interface{}{
			map[string]interface{}{
				"filteringTags": []map[string]interface{}{
					map[string]interface{}{
						"action": "string",
						"name":   "string",
						"value":  "string",
					},
				},
				"subscriptionId": "string",
			},
		},
		"sendMetrics": false,
	},
	RuleSetName: "string",
})
Copy
var metricsSourceTagRuleResource = new MetricsSourceTagRule("metricsSourceTagRuleResource", MetricsSourceTagRuleArgs.builder()
    .metricsSourceName("string")
    .monitorName("string")
    .resourceGroupName("string")
    .properties(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .ruleSetName("string")
    .build());
Copy
metrics_source_tag_rule_resource = azure_native.logz.MetricsSourceTagRule("metricsSourceTagRuleResource",
    metrics_source_name=string,
    monitor_name=string,
    resource_group_name=string,
    properties={
        metricRules: [{
            filteringTags: [{
                action: string,
                name: string,
                value: string,
            }],
            subscriptionId: string,
        }],
        sendMetrics: False,
    },
    rule_set_name=string)
Copy
const metricsSourceTagRuleResource = new azure_native.logz.MetricsSourceTagRule("metricsSourceTagRuleResource", {
    metricsSourceName: "string",
    monitorName: "string",
    resourceGroupName: "string",
    properties: {
        metricRules: [{
            filteringTags: [{
                action: "string",
                name: "string",
                value: "string",
            }],
            subscriptionId: "string",
        }],
        sendMetrics: false,
    },
    ruleSetName: "string",
});
Copy
type: azure-native:logz:MetricsSourceTagRule
properties:
    metricsSourceName: string
    monitorName: string
    properties:
        metricRules:
            - filteringTags:
                - action: string
                  name: string
                  value: string
              subscriptionId: string
        sendMetrics: false
    resourceGroupName: string
    ruleSetName: string
Copy

MetricsSourceTagRule Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The MetricsSourceTagRule resource accepts the following input properties:

MetricsSourceName
This property is required.
Changes to this property will trigger replacement.
string
Metrics Account resource name
MonitorName
This property is required.
Changes to this property will trigger replacement.
string
Monitor resource name
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
Properties Pulumi.AzureNative.Logz.Inputs.MetricsTagRulesProperties
Definition of the properties for a TagRules resource.
RuleSetName Changes to this property will trigger replacement. string
MetricsSourceName
This property is required.
Changes to this property will trigger replacement.
string
Metrics Account resource name
MonitorName
This property is required.
Changes to this property will trigger replacement.
string
Monitor resource name
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
Properties MetricsTagRulesPropertiesArgs
Definition of the properties for a TagRules resource.
RuleSetName Changes to this property will trigger replacement. string
metricsSourceName
This property is required.
Changes to this property will trigger replacement.
String
Metrics Account resource name
monitorName
This property is required.
Changes to this property will trigger replacement.
String
Monitor resource name
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
properties MetricsTagRulesProperties
Definition of the properties for a TagRules resource.
ruleSetName Changes to this property will trigger replacement. String
metricsSourceName
This property is required.
Changes to this property will trigger replacement.
string
Metrics Account resource name
monitorName
This property is required.
Changes to this property will trigger replacement.
string
Monitor resource name
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
properties MetricsTagRulesProperties
Definition of the properties for a TagRules resource.
ruleSetName Changes to this property will trigger replacement. string
metrics_source_name
This property is required.
Changes to this property will trigger replacement.
str
Metrics Account resource name
monitor_name
This property is required.
Changes to this property will trigger replacement.
str
Monitor resource name
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group. The name is case insensitive.
properties MetricsTagRulesPropertiesArgs
Definition of the properties for a TagRules resource.
rule_set_name Changes to this property will trigger replacement. str
metricsSourceName
This property is required.
Changes to this property will trigger replacement.
String
Metrics Account resource name
monitorName
This property is required.
Changes to this property will trigger replacement.
String
Monitor resource name
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
properties Property Map
Definition of the properties for a TagRules resource.
ruleSetName Changes to this property will trigger replacement. String

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
Name of the rule set.
SystemData Pulumi.AzureNative.Logz.Outputs.SystemDataResponse
The system metadata relating to this resource
Type string
The type of the rule set.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Name of the rule set.
SystemData SystemDataResponse
The system metadata relating to this resource
Type string
The type of the rule set.
id String
The provider-assigned unique ID for this managed resource.
name String
Name of the rule set.
systemData SystemDataResponse
The system metadata relating to this resource
type String
The type of the rule set.
id string
The provider-assigned unique ID for this managed resource.
name string
Name of the rule set.
systemData SystemDataResponse
The system metadata relating to this resource
type string
The type of the rule set.
id str
The provider-assigned unique ID for this managed resource.
name str
Name of the rule set.
system_data SystemDataResponse
The system metadata relating to this resource
type str
The type of the rule set.
id String
The provider-assigned unique ID for this managed resource.
name String
Name of the rule set.
systemData Property Map
The system metadata relating to this resource
type String
The type of the rule set.

Supporting Types

FilteringTag
, FilteringTagArgs

Action string | Pulumi.AzureNative.Logz.TagAction
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
Name string
The name (also known as the key) of the tag.
Value string
The value of the tag.
Action string | TagAction
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
Name string
The name (also known as the key) of the tag.
Value string
The value of the tag.
action String | TagAction
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
name String
The name (also known as the key) of the tag.
value String
The value of the tag.
action string | TagAction
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
name string
The name (also known as the key) of the tag.
value string
The value of the tag.
action str | TagAction
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
name str
The name (also known as the key) of the tag.
value str
The value of the tag.
action String | "Include" | "Exclude"
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
name String
The name (also known as the key) of the tag.
value String
The value of the tag.

FilteringTagResponse
, FilteringTagResponseArgs

Action string
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
Name string
The name (also known as the key) of the tag.
Value string
The value of the tag.
Action string
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
Name string
The name (also known as the key) of the tag.
Value string
The value of the tag.
action String
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
name String
The name (also known as the key) of the tag.
value String
The value of the tag.
action string
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
name string
The name (also known as the key) of the tag.
value string
The value of the tag.
action str
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
name str
The name (also known as the key) of the tag.
value str
The value of the tag.
action String
Valid actions for a filtering tag. Exclusion takes priority over inclusion.
name String
The name (also known as the key) of the tag.
value String
The value of the tag.

MetricRules
, MetricRulesArgs

FilteringTags List<Pulumi.AzureNative.Logz.Inputs.FilteringTag>
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
SubscriptionId string
Subscription Id for which filtering tags are applicable
FilteringTags []FilteringTag
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
SubscriptionId string
Subscription Id for which filtering tags are applicable
filteringTags List<FilteringTag>
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
subscriptionId String
Subscription Id for which filtering tags are applicable
filteringTags FilteringTag[]
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
subscriptionId string
Subscription Id for which filtering tags are applicable
filtering_tags Sequence[FilteringTag]
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
subscription_id str
Subscription Id for which filtering tags are applicable
filteringTags List<Property Map>
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
subscriptionId String
Subscription Id for which filtering tags are applicable

MetricRulesResponse
, MetricRulesResponseArgs

FilteringTags List<Pulumi.AzureNative.Logz.Inputs.FilteringTagResponse>
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
SubscriptionId string
Subscription Id for which filtering tags are applicable
FilteringTags []FilteringTagResponse
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
SubscriptionId string
Subscription Id for which filtering tags are applicable
filteringTags List<FilteringTagResponse>
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
subscriptionId String
Subscription Id for which filtering tags are applicable
filteringTags FilteringTagResponse[]
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
subscriptionId string
Subscription Id for which filtering tags are applicable
filtering_tags Sequence[FilteringTagResponse]
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
subscription_id str
Subscription Id for which filtering tags are applicable
filteringTags List<Property Map>
List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
subscriptionId String
Subscription Id for which filtering tags are applicable

MetricsTagRulesProperties
, MetricsTagRulesPropertiesArgs

MetricRules List<Pulumi.AzureNative.Logz.Inputs.MetricRules>
SendMetrics bool
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
MetricRules []MetricRules
SendMetrics bool
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
metricRules List<MetricRules>
sendMetrics Boolean
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
metricRules MetricRules[]
sendMetrics boolean
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
metric_rules Sequence[MetricRules]
send_metrics bool
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
metricRules List<Property Map>
sendMetrics Boolean
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.

MetricsTagRulesPropertiesResponse
, MetricsTagRulesPropertiesResponseArgs

ProvisioningState This property is required. string
Flag specifying if the resource provisioning state as tracked by ARM.
SystemData This property is required. Pulumi.AzureNative.Logz.Inputs.SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
MetricRules List<Pulumi.AzureNative.Logz.Inputs.MetricRulesResponse>
SendMetrics bool
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
ProvisioningState This property is required. string
Flag specifying if the resource provisioning state as tracked by ARM.
SystemData This property is required. SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
MetricRules []MetricRulesResponse
SendMetrics bool
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
provisioningState This property is required. String
Flag specifying if the resource provisioning state as tracked by ARM.
systemData This property is required. SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
metricRules List<MetricRulesResponse>
sendMetrics Boolean
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
provisioningState This property is required. string
Flag specifying if the resource provisioning state as tracked by ARM.
systemData This property is required. SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
metricRules MetricRulesResponse[]
sendMetrics boolean
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
provisioning_state This property is required. str
Flag specifying if the resource provisioning state as tracked by ARM.
system_data This property is required. SystemDataResponse
Metadata pertaining to creation and last modification of the resource.
metric_rules Sequence[MetricRulesResponse]
send_metrics bool
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.
provisioningState This property is required. String
Flag specifying if the resource provisioning state as tracked by ARM.
systemData This property is required. Property Map
Metadata pertaining to creation and last modification of the resource.
metricRules List<Property Map>
sendMetrics Boolean
Flag specifying if metrics from Azure resources should be sent for the Monitor resource.

SystemDataResponse
, SystemDataResponseArgs

CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
CreatedAt string
The timestamp of resource creation (UTC).
CreatedBy string
The identity that created the resource.
CreatedByType string
The type of identity that created the resource.
LastModifiedAt string
The timestamp of resource last modification (UTC)
LastModifiedBy string
The identity that last modified the resource.
LastModifiedByType string
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.
createdAt string
The timestamp of resource creation (UTC).
createdBy string
The identity that created the resource.
createdByType string
The type of identity that created the resource.
lastModifiedAt string
The timestamp of resource last modification (UTC)
lastModifiedBy string
The identity that last modified the resource.
lastModifiedByType string
The type of identity that last modified the resource.
created_at str
The timestamp of resource creation (UTC).
created_by str
The identity that created the resource.
created_by_type str
The type of identity that created the resource.
last_modified_at str
The timestamp of resource last modification (UTC)
last_modified_by str
The identity that last modified the resource.
last_modified_by_type str
The type of identity that last modified the resource.
createdAt String
The timestamp of resource creation (UTC).
createdBy String
The identity that created the resource.
createdByType String
The type of identity that created the resource.
lastModifiedAt String
The timestamp of resource last modification (UTC)
lastModifiedBy String
The identity that last modified the resource.
lastModifiedByType String
The type of identity that last modified the resource.

TagAction
, TagActionArgs

Include
Include
Exclude
Exclude
TagActionInclude
Include
TagActionExclude
Exclude
Include
Include
Exclude
Exclude
Include
Include
Exclude
Exclude
INCLUDE
Include
EXCLUDE
Exclude
"Include"
Include
"Exclude"
Exclude

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:logz:MetricsSourceTagRule default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logz/monitors/{monitorName}/metricsSource/{metricsSourceName}/tagRules/{ruleSetName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0