1. Packages
  2. Azure Classic
  3. API Docs
  4. monitoring
  5. DataCollectionRuleAssociation

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.monitoring.DataCollectionRuleAssociation

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Manages a Data Collection Rule Association.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
        name: "virtualnetwork",
        addressSpaces: ["10.0.0.0/16"],
        location: example.location,
        resourceGroupName: example.name,
    });
    const exampleSubnet = new azure.network.Subnet("example", {
        name: "subnet",
        resourceGroupName: example.name,
        virtualNetworkName: exampleVirtualNetwork.name,
        addressPrefixes: ["10.0.2.0/24"],
    });
    const exampleNetworkInterface = new azure.network.NetworkInterface("example", {
        name: "nic",
        location: example.location,
        resourceGroupName: example.name,
        ipConfigurations: [{
            name: "internal",
            subnetId: exampleSubnet.id,
            privateIpAddressAllocation: "Dynamic",
        }],
    });
    const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("example", {
        name: "machine",
        resourceGroupName: example.name,
        location: example.location,
        size: "Standard_B1ls",
        adminUsername: "adminuser",
        networkInterfaceIds: [exampleNetworkInterface.id],
        adminPassword: "example-Password@7890",
        disablePasswordAuthentication: false,
        osDisk: {
            caching: "ReadWrite",
            storageAccountType: "Standard_LRS",
        },
        sourceImageReference: {
            publisher: "Canonical",
            offer: "0001-com-ubuntu-server-jammy",
            sku: "22_04-lts",
            version: "latest",
        },
    });
    const exampleDataCollectionRule = new azure.monitoring.DataCollectionRule("example", {
        name: "example-dcr",
        resourceGroupName: example.name,
        location: example.location,
        destinations: {
            azureMonitorMetrics: {
                name: "example-destination-metrics",
            },
        },
        dataFlows: [{
            streams: ["Microsoft-InsightsMetrics"],
            destinations: ["example-destination-metrics"],
        }],
    });
    const exampleDataCollectionEndpoint = new azure.monitoring.DataCollectionEndpoint("example", {
        name: "example-dce",
        resourceGroupName: example.name,
        location: example.location,
    });
    // associate to a Data Collection Rule
    const example1 = new azure.monitoring.DataCollectionRuleAssociation("example1", {
        name: "example1-dcra",
        targetResourceId: exampleLinuxVirtualMachine.id,
        dataCollectionRuleId: exampleDataCollectionRule.id,
        description: "example",
    });
    // associate to a Data Collection Endpoint
    const example2 = new azure.monitoring.DataCollectionRuleAssociation("example2", {
        targetResourceId: exampleLinuxVirtualMachine.id,
        dataCollectionEndpointId: exampleDataCollectionEndpoint.id,
        description: "example",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_virtual_network = azure.network.VirtualNetwork("example",
        name="virtualnetwork",
        address_spaces=["10.0.0.0/16"],
        location=example.location,
        resource_group_name=example.name)
    example_subnet = azure.network.Subnet("example",
        name="subnet",
        resource_group_name=example.name,
        virtual_network_name=example_virtual_network.name,
        address_prefixes=["10.0.2.0/24"])
    example_network_interface = azure.network.NetworkInterface("example",
        name="nic",
        location=example.location,
        resource_group_name=example.name,
        ip_configurations=[{
            "name": "internal",
            "subnet_id": example_subnet.id,
            "private_ip_address_allocation": "Dynamic",
        }])
    example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("example",
        name="machine",
        resource_group_name=example.name,
        location=example.location,
        size="Standard_B1ls",
        admin_username="adminuser",
        network_interface_ids=[example_network_interface.id],
        admin_password="example-Password@7890",
        disable_password_authentication=False,
        os_disk={
            "caching": "ReadWrite",
            "storage_account_type": "Standard_LRS",
        },
        source_image_reference={
            "publisher": "Canonical",
            "offer": "0001-com-ubuntu-server-jammy",
            "sku": "22_04-lts",
            "version": "latest",
        })
    example_data_collection_rule = azure.monitoring.DataCollectionRule("example",
        name="example-dcr",
        resource_group_name=example.name,
        location=example.location,
        destinations={
            "azure_monitor_metrics": {
                "name": "example-destination-metrics",
            },
        },
        data_flows=[{
            "streams": ["Microsoft-InsightsMetrics"],
            "destinations": ["example-destination-metrics"],
        }])
    example_data_collection_endpoint = azure.monitoring.DataCollectionEndpoint("example",
        name="example-dce",
        resource_group_name=example.name,
        location=example.location)
    # associate to a Data Collection Rule
    example1 = azure.monitoring.DataCollectionRuleAssociation("example1",
        name="example1-dcra",
        target_resource_id=example_linux_virtual_machine.id,
        data_collection_rule_id=example_data_collection_rule.id,
        description="example")
    # associate to a Data Collection Endpoint
    example2 = azure.monitoring.DataCollectionRuleAssociation("example2",
        target_resource_id=example_linux_virtual_machine.id,
        data_collection_endpoint_id=example_data_collection_endpoint.id,
        description="example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/monitoring"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
    			Name: pulumi.String("virtualnetwork"),
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("10.0.0.0/16"),
    			},
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    		})
    		if err != nil {
    			return err
    		}
    		exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
    			Name:               pulumi.String("subnet"),
    			ResourceGroupName:  example.Name,
    			VirtualNetworkName: exampleVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("10.0.2.0/24"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "example", &network.NetworkInterfaceArgs{
    			Name:              pulumi.String("nic"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
    				&network.NetworkInterfaceIpConfigurationArgs{
    					Name:                       pulumi.String("internal"),
    					SubnetId:                   exampleSubnet.ID(),
    					PrivateIpAddressAllocation: pulumi.String("Dynamic"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "example", &compute.LinuxVirtualMachineArgs{
    			Name:              pulumi.String("machine"),
    			ResourceGroupName: example.Name,
    			Location:          example.Location,
    			Size:              pulumi.String("Standard_B1ls"),
    			AdminUsername:     pulumi.String("adminuser"),
    			NetworkInterfaceIds: pulumi.StringArray{
    				exampleNetworkInterface.ID(),
    			},
    			AdminPassword:                 pulumi.String("example-Password@7890"),
    			DisablePasswordAuthentication: pulumi.Bool(false),
    			OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{
    				Caching:            pulumi.String("ReadWrite"),
    				StorageAccountType: pulumi.String("Standard_LRS"),
    			},
    			SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{
    				Publisher: pulumi.String("Canonical"),
    				Offer:     pulumi.String("0001-com-ubuntu-server-jammy"),
    				Sku:       pulumi.String("22_04-lts"),
    				Version:   pulumi.String("latest"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleDataCollectionRule, err := monitoring.NewDataCollectionRule(ctx, "example", &monitoring.DataCollectionRuleArgs{
    			Name:              pulumi.String("example-dcr"),
    			ResourceGroupName: example.Name,
    			Location:          example.Location,
    			Destinations: &monitoring.DataCollectionRuleDestinationsArgs{
    				AzureMonitorMetrics: &monitoring.DataCollectionRuleDestinationsAzureMonitorMetricsArgs{
    					Name: pulumi.String("example-destination-metrics"),
    				},
    			},
    			DataFlows: monitoring.DataCollectionRuleDataFlowArray{
    				&monitoring.DataCollectionRuleDataFlowArgs{
    					Streams: pulumi.StringArray{
    						pulumi.String("Microsoft-InsightsMetrics"),
    					},
    					Destinations: pulumi.StringArray{
    						pulumi.String("example-destination-metrics"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleDataCollectionEndpoint, err := monitoring.NewDataCollectionEndpoint(ctx, "example", &monitoring.DataCollectionEndpointArgs{
    			Name:              pulumi.String("example-dce"),
    			ResourceGroupName: example.Name,
    			Location:          example.Location,
    		})
    		if err != nil {
    			return err
    		}
    		// associate to a Data Collection Rule
    		_, err = monitoring.NewDataCollectionRuleAssociation(ctx, "example1", &monitoring.DataCollectionRuleAssociationArgs{
    			Name:                 pulumi.String("example1-dcra"),
    			TargetResourceId:     exampleLinuxVirtualMachine.ID(),
    			DataCollectionRuleId: exampleDataCollectionRule.ID(),
    			Description:          pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		// associate to a Data Collection Endpoint
    		_, err = monitoring.NewDataCollectionRuleAssociation(ctx, "example2", &monitoring.DataCollectionRuleAssociationArgs{
    			TargetResourceId:         exampleLinuxVirtualMachine.ID(),
    			DataCollectionEndpointId: exampleDataCollectionEndpoint.ID(),
    			Description:              pulumi.String("example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
        {
            Name = "virtualnetwork",
            AddressSpaces = new[]
            {
                "10.0.0.0/16",
            },
            Location = example.Location,
            ResourceGroupName = example.Name,
        });
    
        var exampleSubnet = new Azure.Network.Subnet("example", new()
        {
            Name = "subnet",
            ResourceGroupName = example.Name,
            VirtualNetworkName = exampleVirtualNetwork.Name,
            AddressPrefixes = new[]
            {
                "10.0.2.0/24",
            },
        });
    
        var exampleNetworkInterface = new Azure.Network.NetworkInterface("example", new()
        {
            Name = "nic",
            Location = example.Location,
            ResourceGroupName = example.Name,
            IpConfigurations = new[]
            {
                new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs
                {
                    Name = "internal",
                    SubnetId = exampleSubnet.Id,
                    PrivateIpAddressAllocation = "Dynamic",
                },
            },
        });
    
        var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("example", new()
        {
            Name = "machine",
            ResourceGroupName = example.Name,
            Location = example.Location,
            Size = "Standard_B1ls",
            AdminUsername = "adminuser",
            NetworkInterfaceIds = new[]
            {
                exampleNetworkInterface.Id,
            },
            AdminPassword = "example-Password@7890",
            DisablePasswordAuthentication = false,
            OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs
            {
                Caching = "ReadWrite",
                StorageAccountType = "Standard_LRS",
            },
            SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs
            {
                Publisher = "Canonical",
                Offer = "0001-com-ubuntu-server-jammy",
                Sku = "22_04-lts",
                Version = "latest",
            },
        });
    
        var exampleDataCollectionRule = new Azure.Monitoring.DataCollectionRule("example", new()
        {
            Name = "example-dcr",
            ResourceGroupName = example.Name,
            Location = example.Location,
            Destinations = new Azure.Monitoring.Inputs.DataCollectionRuleDestinationsArgs
            {
                AzureMonitorMetrics = new Azure.Monitoring.Inputs.DataCollectionRuleDestinationsAzureMonitorMetricsArgs
                {
                    Name = "example-destination-metrics",
                },
            },
            DataFlows = new[]
            {
                new Azure.Monitoring.Inputs.DataCollectionRuleDataFlowArgs
                {
                    Streams = new[]
                    {
                        "Microsoft-InsightsMetrics",
                    },
                    Destinations = new[]
                    {
                        "example-destination-metrics",
                    },
                },
            },
        });
    
        var exampleDataCollectionEndpoint = new Azure.Monitoring.DataCollectionEndpoint("example", new()
        {
            Name = "example-dce",
            ResourceGroupName = example.Name,
            Location = example.Location,
        });
    
        // associate to a Data Collection Rule
        var example1 = new Azure.Monitoring.DataCollectionRuleAssociation("example1", new()
        {
            Name = "example1-dcra",
            TargetResourceId = exampleLinuxVirtualMachine.Id,
            DataCollectionRuleId = exampleDataCollectionRule.Id,
            Description = "example",
        });
    
        // associate to a Data Collection Endpoint
        var example2 = new Azure.Monitoring.DataCollectionRuleAssociation("example2", new()
        {
            TargetResourceId = exampleLinuxVirtualMachine.Id,
            DataCollectionEndpointId = exampleDataCollectionEndpoint.Id,
            Description = "example",
        });
    
    });
    
    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.network.VirtualNetwork;
    import com.pulumi.azure.network.VirtualNetworkArgs;
    import com.pulumi.azure.network.Subnet;
    import com.pulumi.azure.network.SubnetArgs;
    import com.pulumi.azure.network.NetworkInterface;
    import com.pulumi.azure.network.NetworkInterfaceArgs;
    import com.pulumi.azure.network.inputs.NetworkInterfaceIpConfigurationArgs;
    import com.pulumi.azure.compute.LinuxVirtualMachine;
    import com.pulumi.azure.compute.LinuxVirtualMachineArgs;
    import com.pulumi.azure.compute.inputs.LinuxVirtualMachineOsDiskArgs;
    import com.pulumi.azure.compute.inputs.LinuxVirtualMachineSourceImageReferenceArgs;
    import com.pulumi.azure.monitoring.DataCollectionRule;
    import com.pulumi.azure.monitoring.DataCollectionRuleArgs;
    import com.pulumi.azure.monitoring.inputs.DataCollectionRuleDestinationsArgs;
    import com.pulumi.azure.monitoring.inputs.DataCollectionRuleDestinationsAzureMonitorMetricsArgs;
    import com.pulumi.azure.monitoring.inputs.DataCollectionRuleDataFlowArgs;
    import com.pulumi.azure.monitoring.DataCollectionEndpoint;
    import com.pulumi.azure.monitoring.DataCollectionEndpointArgs;
    import com.pulumi.azure.monitoring.DataCollectionRuleAssociation;
    import com.pulumi.azure.monitoring.DataCollectionRuleAssociationArgs;
    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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
                .name("virtualnetwork")
                .addressSpaces("10.0.0.0/16")
                .location(example.location())
                .resourceGroupName(example.name())
                .build());
    
            var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
                .name("subnet")
                .resourceGroupName(example.name())
                .virtualNetworkName(exampleVirtualNetwork.name())
                .addressPrefixes("10.0.2.0/24")
                .build());
    
            var exampleNetworkInterface = new NetworkInterface("exampleNetworkInterface", NetworkInterfaceArgs.builder()
                .name("nic")
                .location(example.location())
                .resourceGroupName(example.name())
                .ipConfigurations(NetworkInterfaceIpConfigurationArgs.builder()
                    .name("internal")
                    .subnetId(exampleSubnet.id())
                    .privateIpAddressAllocation("Dynamic")
                    .build())
                .build());
    
            var exampleLinuxVirtualMachine = new LinuxVirtualMachine("exampleLinuxVirtualMachine", LinuxVirtualMachineArgs.builder()
                .name("machine")
                .resourceGroupName(example.name())
                .location(example.location())
                .size("Standard_B1ls")
                .adminUsername("adminuser")
                .networkInterfaceIds(exampleNetworkInterface.id())
                .adminPassword("example-Password@7890")
                .disablePasswordAuthentication(false)
                .osDisk(LinuxVirtualMachineOsDiskArgs.builder()
                    .caching("ReadWrite")
                    .storageAccountType("Standard_LRS")
                    .build())
                .sourceImageReference(LinuxVirtualMachineSourceImageReferenceArgs.builder()
                    .publisher("Canonical")
                    .offer("0001-com-ubuntu-server-jammy")
                    .sku("22_04-lts")
                    .version("latest")
                    .build())
                .build());
    
            var exampleDataCollectionRule = new DataCollectionRule("exampleDataCollectionRule", DataCollectionRuleArgs.builder()
                .name("example-dcr")
                .resourceGroupName(example.name())
                .location(example.location())
                .destinations(DataCollectionRuleDestinationsArgs.builder()
                    .azureMonitorMetrics(DataCollectionRuleDestinationsAzureMonitorMetricsArgs.builder()
                        .name("example-destination-metrics")
                        .build())
                    .build())
                .dataFlows(DataCollectionRuleDataFlowArgs.builder()
                    .streams("Microsoft-InsightsMetrics")
                    .destinations("example-destination-metrics")
                    .build())
                .build());
    
            var exampleDataCollectionEndpoint = new DataCollectionEndpoint("exampleDataCollectionEndpoint", DataCollectionEndpointArgs.builder()
                .name("example-dce")
                .resourceGroupName(example.name())
                .location(example.location())
                .build());
    
            // associate to a Data Collection Rule
            var example1 = new DataCollectionRuleAssociation("example1", DataCollectionRuleAssociationArgs.builder()
                .name("example1-dcra")
                .targetResourceId(exampleLinuxVirtualMachine.id())
                .dataCollectionRuleId(exampleDataCollectionRule.id())
                .description("example")
                .build());
    
            // associate to a Data Collection Endpoint
            var example2 = new DataCollectionRuleAssociation("example2", DataCollectionRuleAssociationArgs.builder()
                .targetResourceId(exampleLinuxVirtualMachine.id())
                .dataCollectionEndpointId(exampleDataCollectionEndpoint.id())
                .description("example")
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleVirtualNetwork:
        type: azure:network:VirtualNetwork
        name: example
        properties:
          name: virtualnetwork
          addressSpaces:
            - 10.0.0.0/16
          location: ${example.location}
          resourceGroupName: ${example.name}
      exampleSubnet:
        type: azure:network:Subnet
        name: example
        properties:
          name: subnet
          resourceGroupName: ${example.name}
          virtualNetworkName: ${exampleVirtualNetwork.name}
          addressPrefixes:
            - 10.0.2.0/24
      exampleNetworkInterface:
        type: azure:network:NetworkInterface
        name: example
        properties:
          name: nic
          location: ${example.location}
          resourceGroupName: ${example.name}
          ipConfigurations:
            - name: internal
              subnetId: ${exampleSubnet.id}
              privateIpAddressAllocation: Dynamic
      exampleLinuxVirtualMachine:
        type: azure:compute:LinuxVirtualMachine
        name: example
        properties:
          name: machine
          resourceGroupName: ${example.name}
          location: ${example.location}
          size: Standard_B1ls
          adminUsername: adminuser
          networkInterfaceIds:
            - ${exampleNetworkInterface.id}
          adminPassword: example-Password@7890
          disablePasswordAuthentication: false
          osDisk:
            caching: ReadWrite
            storageAccountType: Standard_LRS
          sourceImageReference:
            publisher: Canonical
            offer: 0001-com-ubuntu-server-jammy
            sku: 22_04-lts
            version: latest
      exampleDataCollectionRule:
        type: azure:monitoring:DataCollectionRule
        name: example
        properties:
          name: example-dcr
          resourceGroupName: ${example.name}
          location: ${example.location}
          destinations:
            azureMonitorMetrics:
              name: example-destination-metrics
          dataFlows:
            - streams:
                - Microsoft-InsightsMetrics
              destinations:
                - example-destination-metrics
      exampleDataCollectionEndpoint:
        type: azure:monitoring:DataCollectionEndpoint
        name: example
        properties:
          name: example-dce
          resourceGroupName: ${example.name}
          location: ${example.location}
      # associate to a Data Collection Rule
      example1:
        type: azure:monitoring:DataCollectionRuleAssociation
        properties:
          name: example1-dcra
          targetResourceId: ${exampleLinuxVirtualMachine.id}
          dataCollectionRuleId: ${exampleDataCollectionRule.id}
          description: example
      # associate to a Data Collection Endpoint
      example2:
        type: azure:monitoring:DataCollectionRuleAssociation
        properties:
          targetResourceId: ${exampleLinuxVirtualMachine.id}
          dataCollectionEndpointId: ${exampleDataCollectionEndpoint.id}
          description: example
    

    Create DataCollectionRuleAssociation Resource

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

    Constructor syntax

    new DataCollectionRuleAssociation(name: string, args: DataCollectionRuleAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def DataCollectionRuleAssociation(resource_name: str,
                                      args: DataCollectionRuleAssociationArgs,
                                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def DataCollectionRuleAssociation(resource_name: str,
                                      opts: Optional[ResourceOptions] = None,
                                      target_resource_id: Optional[str] = None,
                                      data_collection_endpoint_id: Optional[str] = None,
                                      data_collection_rule_id: Optional[str] = None,
                                      description: Optional[str] = None,
                                      name: Optional[str] = None)
    func NewDataCollectionRuleAssociation(ctx *Context, name string, args DataCollectionRuleAssociationArgs, opts ...ResourceOption) (*DataCollectionRuleAssociation, error)
    public DataCollectionRuleAssociation(string name, DataCollectionRuleAssociationArgs args, CustomResourceOptions? opts = null)
    public DataCollectionRuleAssociation(String name, DataCollectionRuleAssociationArgs args)
    public DataCollectionRuleAssociation(String name, DataCollectionRuleAssociationArgs args, CustomResourceOptions options)
    
    type: azure:monitoring:DataCollectionRuleAssociation
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args DataCollectionRuleAssociationArgs
    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 DataCollectionRuleAssociationArgs
    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 DataCollectionRuleAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DataCollectionRuleAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DataCollectionRuleAssociationArgs
    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 dataCollectionRuleAssociationResource = new Azure.Monitoring.DataCollectionRuleAssociation("dataCollectionRuleAssociationResource", new()
    {
        TargetResourceId = "string",
        DataCollectionEndpointId = "string",
        DataCollectionRuleId = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := monitoring.NewDataCollectionRuleAssociation(ctx, "dataCollectionRuleAssociationResource", &monitoring.DataCollectionRuleAssociationArgs{
    	TargetResourceId:         pulumi.String("string"),
    	DataCollectionEndpointId: pulumi.String("string"),
    	DataCollectionRuleId:     pulumi.String("string"),
    	Description:              pulumi.String("string"),
    	Name:                     pulumi.String("string"),
    })
    
    var dataCollectionRuleAssociationResource = new DataCollectionRuleAssociation("dataCollectionRuleAssociationResource", DataCollectionRuleAssociationArgs.builder()
        .targetResourceId("string")
        .dataCollectionEndpointId("string")
        .dataCollectionRuleId("string")
        .description("string")
        .name("string")
        .build());
    
    data_collection_rule_association_resource = azure.monitoring.DataCollectionRuleAssociation("dataCollectionRuleAssociationResource",
        target_resource_id="string",
        data_collection_endpoint_id="string",
        data_collection_rule_id="string",
        description="string",
        name="string")
    
    const dataCollectionRuleAssociationResource = new azure.monitoring.DataCollectionRuleAssociation("dataCollectionRuleAssociationResource", {
        targetResourceId: "string",
        dataCollectionEndpointId: "string",
        dataCollectionRuleId: "string",
        description: "string",
        name: "string",
    });
    
    type: azure:monitoring:DataCollectionRuleAssociation
    properties:
        dataCollectionEndpointId: string
        dataCollectionRuleId: string
        description: string
        name: string
        targetResourceId: string
    

    DataCollectionRuleAssociation 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 DataCollectionRuleAssociation resource accepts the following input properties:

    TargetResourceId string
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    DataCollectionEndpointId string
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    DataCollectionRuleId string

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    Description string
    The description of the Data Collection Rule Association.
    Name string

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    TargetResourceId string
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    DataCollectionEndpointId string
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    DataCollectionRuleId string

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    Description string
    The description of the Data Collection Rule Association.
    Name string

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    targetResourceId String
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    dataCollectionEndpointId String
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    dataCollectionRuleId String

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    description String
    The description of the Data Collection Rule Association.
    name String

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    targetResourceId string
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    dataCollectionEndpointId string
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    dataCollectionRuleId string

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    description string
    The description of the Data Collection Rule Association.
    name string

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    target_resource_id str
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    data_collection_endpoint_id str
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    data_collection_rule_id str

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    description str
    The description of the Data Collection Rule Association.
    name str

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    targetResourceId String
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    dataCollectionEndpointId String
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    dataCollectionRuleId String

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    description String
    The description of the Data Collection Rule Association.
    name String

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DataCollectionRuleAssociation 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 DataCollectionRuleAssociation Resource

    Get an existing DataCollectionRuleAssociation 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?: DataCollectionRuleAssociationState, opts?: CustomResourceOptions): DataCollectionRuleAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data_collection_endpoint_id: Optional[str] = None,
            data_collection_rule_id: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            target_resource_id: Optional[str] = None) -> DataCollectionRuleAssociation
    func GetDataCollectionRuleAssociation(ctx *Context, name string, id IDInput, state *DataCollectionRuleAssociationState, opts ...ResourceOption) (*DataCollectionRuleAssociation, error)
    public static DataCollectionRuleAssociation Get(string name, Input<string> id, DataCollectionRuleAssociationState? state, CustomResourceOptions? opts = null)
    public static DataCollectionRuleAssociation get(String name, Output<String> id, DataCollectionRuleAssociationState 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:
    DataCollectionEndpointId string
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    DataCollectionRuleId string

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    Description string
    The description of the Data Collection Rule Association.
    Name string

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    TargetResourceId string
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    DataCollectionEndpointId string
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    DataCollectionRuleId string

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    Description string
    The description of the Data Collection Rule Association.
    Name string

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    TargetResourceId string
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    dataCollectionEndpointId String
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    dataCollectionRuleId String

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    description String
    The description of the Data Collection Rule Association.
    name String

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    targetResourceId String
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    dataCollectionEndpointId string
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    dataCollectionRuleId string

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    description string
    The description of the Data Collection Rule Association.
    name string

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    targetResourceId string
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    data_collection_endpoint_id str
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    data_collection_rule_id str

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    description str
    The description of the Data Collection Rule Association.
    name str

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    target_resource_id str
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.
    dataCollectionEndpointId String
    The ID of the Data Collection Endpoint which will be associated to the target resource.
    dataCollectionRuleId String

    The ID of the Data Collection Rule which will be associated to the target resource.

    NOTE Exactly one of data_collection_endpoint_id and data_collection_rule_id blocks must be specified.

    description String
    The description of the Data Collection Rule Association.
    name String

    The name which should be used for this Data Collection Rule Association. Changing this forces a new Data Collection Rule Association to be created. Defaults to configurationAccessEndpoint.

    NOTE name is required when data_collection_rule_id is specified. And when data_collection_endpoint_id is specified, the name is populated with configurationAccessEndpoint.

    targetResourceId String
    The ID of the Azure Resource which to associate to a Data Collection Rule or a Data Collection Endpoint. Changing this forces a new resource to be created.

    Import

    Data Collection Rules Association can be imported using the resource id, e.g.

    $ pulumi import azure:monitoring/dataCollectionRuleAssociation:DataCollectionRuleAssociation example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/dataCollectionRuleAssociations/dca1
    

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

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi