import * as pulumi from "@pulumi/pulumi"; /** * Manages a Data Collection Rule Association. * * ## Example Usage * * ```typescript * 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", * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Insights` - 2023-03-11 * * ## Import * * Data Collection Rules Association can be imported using the `resource id`, e.g. * * ```sh * $ 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 * ``` */ export declare class DataCollectionRuleAssociation extends pulumi.CustomResource { /** * Get an existing DataCollectionRuleAssociation resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: DataCollectionRuleAssociationState, opts?: pulumi.CustomResourceOptions): DataCollectionRuleAssociation; /** * Returns true if the given object is an instance of DataCollectionRuleAssociation. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is DataCollectionRuleAssociation; /** * The ID of the Data Collection Endpoint which will be associated to the target resource. */ readonly dataCollectionEndpointId: pulumi.Output; /** * The ID of the Data Collection Rule which will be associated to the target resource. * * > **Note:** Exactly one of `dataCollectionEndpointId` and `dataCollectionRuleId` blocks must be specified. */ readonly dataCollectionRuleId: pulumi.Output; /** * The description of the Data Collection Rule Association. */ readonly description: pulumi.Output; /** * 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 `dataCollectionRuleId` is specified. And when `dataCollectionEndpointId` is specified, the `name` is populated with `configurationAccessEndpoint`. */ readonly name: pulumi.Output; /** * 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. */ readonly targetResourceId: pulumi.Output; /** * Create a DataCollectionRuleAssociation resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DataCollectionRuleAssociationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DataCollectionRuleAssociation resources. */ export interface DataCollectionRuleAssociationState { /** * The ID of the Data Collection Endpoint which will be associated to the target resource. */ dataCollectionEndpointId?: pulumi.Input; /** * The ID of the Data Collection Rule which will be associated to the target resource. * * > **Note:** Exactly one of `dataCollectionEndpointId` and `dataCollectionRuleId` blocks must be specified. */ dataCollectionRuleId?: pulumi.Input; /** * The description of the Data Collection Rule Association. */ description?: pulumi.Input; /** * 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 `dataCollectionRuleId` is specified. And when `dataCollectionEndpointId` is specified, the `name` is populated with `configurationAccessEndpoint`. */ name?: pulumi.Input; /** * 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. */ targetResourceId?: pulumi.Input; } /** * The set of arguments for constructing a DataCollectionRuleAssociation resource. */ export interface DataCollectionRuleAssociationArgs { /** * The ID of the Data Collection Endpoint which will be associated to the target resource. */ dataCollectionEndpointId?: pulumi.Input; /** * The ID of the Data Collection Rule which will be associated to the target resource. * * > **Note:** Exactly one of `dataCollectionEndpointId` and `dataCollectionRuleId` blocks must be specified. */ dataCollectionRuleId?: pulumi.Input; /** * The description of the Data Collection Rule Association. */ description?: pulumi.Input; /** * 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 `dataCollectionRuleId` is specified. And when `dataCollectionEndpointId` is specified, the `name` is populated with `configurationAccessEndpoint`. */ name?: pulumi.Input; /** * 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. */ targetResourceId: pulumi.Input; }