Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Azure Native

v1.42.0 published on Monday, Oct 25, 2021 by Pulumi

GuestDiagnosticsSetting

Virtual machine guest diagnostics settings resource. API Version: 2018-06-01-preview.

Example Usage

Create or update a guest diagnostic settings

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var guestDiagnosticsSetting = new AzureNative.Insights.GuestDiagnosticsSetting("guestDiagnosticsSetting", new AzureNative.Insights.GuestDiagnosticsSettingArgs
        {
            DataSources = 
            {
                new AzureNative.Insights.Inputs.DataSourceArgs
                {
                    Configuration = new AzureNative.Insights.Inputs.DataSourceConfigurationArgs
                    {
                        PerfCounters = 
                        {
                            new AzureNative.Insights.Inputs.PerformanceCounterConfigurationArgs
                            {
                                Name = "\\Process(_Total)\\%Processor Time",
                                SamplingPeriod = "PT1M",
                            },
                            new AzureNative.Insights.Inputs.PerformanceCounterConfigurationArgs
                            {
                                Name = "\\Process(_Total)\\Working Set",
                                SamplingPeriod = "PT1M",
                            },
                        },
                    },
                    Kind = "PerformanceCounter",
                    Sinks = 
                    {
                        new AzureNative.Insights.Inputs.SinkConfigurationArgs
                        {
                            Kind = "LogAnalytics",
                        },
                    },
                },
                new AzureNative.Insights.Inputs.DataSourceArgs
                {
                    Configuration = new AzureNative.Insights.Inputs.DataSourceConfigurationArgs
                    {
                        Providers = 
                        {
                            new AzureNative.Insights.Inputs.EtwProviderConfigurationArgs
                            {
                                Id = "1",
                            },
                            new AzureNative.Insights.Inputs.EtwProviderConfigurationArgs
                            {
                                Id = "2",
                            },
                        },
                    },
                    Kind = "ETWProviders",
                    Sinks = 
                    {
                        new AzureNative.Insights.Inputs.SinkConfigurationArgs
                        {
                            Kind = "LogAnalytics",
                        },
                    },
                },
                new AzureNative.Insights.Inputs.DataSourceArgs
                {
                    Configuration = new AzureNative.Insights.Inputs.DataSourceConfigurationArgs
                    {
                        EventLogs = 
                        {
                            new AzureNative.Insights.Inputs.EventLogConfigurationArgs
                            {
                                Filter = "SourceName == Xyz AND EventId = \"100\" AND  $Xpath/Column=\"DCName\" = \"CatWoman\"",
                                LogName = "Application",
                            },
                            new AzureNative.Insights.Inputs.EventLogConfigurationArgs
                            {
                                Filter = "SourceName == Xyz AND EventId = \"100\" AND  $Xpath/Column=\"DCName\" = \"BatMan\"",
                                LogName = "Application",
                            },
                        },
                    },
                    Kind = "WindowsEventLogs",
                    Sinks = 
                    {
                        new AzureNative.Insights.Inputs.SinkConfigurationArgs
                        {
                            Kind = "LogAnalytics",
                        },
                    },
                },
            },
            DiagnosticSettingsName = "SampleDiagSetting",
            Location = "Global",
            OsType = "Windows",
            ResourceGroupName = "Default-ResourceGroup",
            Tags = ,
        });
    }

}

package main

import (
	"fmt"

	insights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewguestDiagnosticsSetting(ctx, "guestDiagnosticsSetting", &insights.guestDiagnosticsSettingArgs{
			DataSources: []insights.DataSourceArgs{
				&insights.DataSourceArgs{
					Configuration: &insights.DataSourceConfigurationArgs{
						PerfCounters: insights.PerformanceCounterConfigurationArray{
							&insights.PerformanceCounterConfigurationArgs{
								Name:           pulumi.String(fmt.Sprintf("%v%v%v", "\\Process(_Total)\\", "%", "Processor Time")),
								SamplingPeriod: pulumi.String("PT1M"),
							},
							&insights.PerformanceCounterConfigurationArgs{
								Name:           pulumi.String("\\Process(_Total)\\Working Set"),
								SamplingPeriod: pulumi.String("PT1M"),
							},
						},
					},
					Kind: pulumi.String("PerformanceCounter"),
					Sinks: []insights.SinkConfigurationArgs{
						&insights.SinkConfigurationArgs{
							Kind: pulumi.String("LogAnalytics"),
						},
					},
				},
				&insights.DataSourceArgs{
					Configuration: &insights.DataSourceConfigurationArgs{
						Providers: insights.EtwProviderConfigurationArray{
							&insights.EtwProviderConfigurationArgs{
								Id: pulumi.String("1"),
							},
							&insights.EtwProviderConfigurationArgs{
								Id: pulumi.String("2"),
							},
						},
					},
					Kind: pulumi.String("ETWProviders"),
					Sinks: []insights.SinkConfigurationArgs{
						&insights.SinkConfigurationArgs{
							Kind: pulumi.String("LogAnalytics"),
						},
					},
				},
				&insights.DataSourceArgs{
					Configuration: &insights.DataSourceConfigurationArgs{
						EventLogs: insights.EventLogConfigurationArray{
							&insights.EventLogConfigurationArgs{
								Filter:  pulumi.String(fmt.Sprintf("%v%v%v", "SourceName == Xyz AND EventId = \"100\" AND  ", "$", "Xpath/Column=\"DCName\" = \"CatWoman\"")),
								LogName: pulumi.String("Application"),
							},
							&insights.EventLogConfigurationArgs{
								Filter:  pulumi.String(fmt.Sprintf("%v%v%v", "SourceName == Xyz AND EventId = \"100\" AND  ", "$", "Xpath/Column=\"DCName\" = \"BatMan\"")),
								LogName: pulumi.String("Application"),
							},
						},
					},
					Kind: pulumi.String("WindowsEventLogs"),
					Sinks: []insights.SinkConfigurationArgs{
						&insights.SinkConfigurationArgs{
							Kind: pulumi.String("LogAnalytics"),
						},
					},
				},
			},
			DiagnosticSettingsName: pulumi.String("SampleDiagSetting"),
			Location:               pulumi.String("Global"),
			OsType:                 pulumi.String("Windows"),
			ResourceGroupName:      pulumi.String("Default-ResourceGroup"),
			Tags:                   nil,
		})
		if err != nil {
			return err
		}
		return nil
	})
}

import pulumi
import pulumi_azure_native as azure_native

guest_diagnostics_setting = azure_native.insights.GuestDiagnosticsSetting("guestDiagnosticsSetting",
    data_sources=[
        azure_native.insights.DataSourceArgs(
            configuration=azure_native.insights.DataSourceConfigurationArgs(
                perf_counters=[
                    azure_native.insights.PerformanceCounterConfigurationArgs(
                        name="\\Process(_Total)\\%Processor Time",
                        sampling_period="PT1M",
                    ),
                    azure_native.insights.PerformanceCounterConfigurationArgs(
                        name="\\Process(_Total)\\Working Set",
                        sampling_period="PT1M",
                    ),
                ],
            ),
            kind="PerformanceCounter",
            sinks=[azure_native.insights.SinkConfigurationArgs(
                kind="LogAnalytics",
            )],
        ),
        azure_native.insights.DataSourceArgs(
            configuration=azure_native.insights.DataSourceConfigurationArgs(
                providers=[
                    azure_native.insights.EtwProviderConfigurationArgs(
                        id="1",
                    ),
                    azure_native.insights.EtwProviderConfigurationArgs(
                        id="2",
                    ),
                ],
            ),
            kind="ETWProviders",
            sinks=[azure_native.insights.SinkConfigurationArgs(
                kind="LogAnalytics",
            )],
        ),
        azure_native.insights.DataSourceArgs(
            configuration=azure_native.insights.DataSourceConfigurationArgs(
                event_logs=[
                    azure_native.insights.EventLogConfigurationArgs(
                        filter="SourceName == Xyz AND EventId = \"100\" AND  $Xpath/Column=\"DCName\" = \"CatWoman\"",
                        log_name="Application",
                    ),
                    azure_native.insights.EventLogConfigurationArgs(
                        filter="SourceName == Xyz AND EventId = \"100\" AND  $Xpath/Column=\"DCName\" = \"BatMan\"",
                        log_name="Application",
                    ),
                ],
            ),
            kind="WindowsEventLogs",
            sinks=[azure_native.insights.SinkConfigurationArgs(
                kind="LogAnalytics",
            )],
        ),
    ],
    diagnostic_settings_name="SampleDiagSetting",
    location="Global",
    os_type="Windows",
    resource_group_name="Default-ResourceGroup",
    tags={})

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

const guestDiagnosticsSetting = new azure_native.insights.GuestDiagnosticsSetting("guestDiagnosticsSetting", {
    dataSources: [
        {
            configuration: {
                perfCounters: [
                    {
                        name: `\Process(_Total)\%Processor Time`,
                        samplingPeriod: "PT1M",
                    },
                    {
                        name: "\\Process(_Total)\\Working Set",
                        samplingPeriod: "PT1M",
                    },
                ],
            },
            kind: "PerformanceCounter",
            sinks: [{
                kind: "LogAnalytics",
            }],
        },
        {
            configuration: {
                providers: [
                    {
                        id: 1,
                    },
                    {
                        id: 2,
                    },
                ],
            },
            kind: "ETWProviders",
            sinks: [{
                kind: "LogAnalytics",
            }],
        },
        {
            configuration: {
                eventLogs: [
                    {
                        filter: `SourceName == Xyz AND EventId = "100" AND  $Xpath/Column="DCName" = "CatWoman"`,
                        logName: "Application",
                    },
                    {
                        filter: `SourceName == Xyz AND EventId = "100" AND  $Xpath/Column="DCName" = "BatMan"`,
                        logName: "Application",
                    },
                ],
            },
            kind: "WindowsEventLogs",
            sinks: [{
                kind: "LogAnalytics",
            }],
        },
    ],
    diagnosticSettingsName: "SampleDiagSetting",
    location: "Global",
    osType: "Windows",
    resourceGroupName: "Default-ResourceGroup",
    tags: {},
});

Create a GuestDiagnosticsSetting Resource

new GuestDiagnosticsSetting(name: string, args: GuestDiagnosticsSettingArgs, opts?: CustomResourceOptions);
@overload
def GuestDiagnosticsSetting(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            data_sources: Optional[Sequence[DataSourceArgs]] = None,
                            diagnostic_settings_name: Optional[str] = None,
                            location: Optional[str] = None,
                            os_type: Optional[str] = None,
                            proxy_setting: Optional[str] = None,
                            resource_group_name: Optional[str] = None,
                            tags: Optional[Mapping[str, str]] = None)
@overload
def GuestDiagnosticsSetting(resource_name: str,
                            args: GuestDiagnosticsSettingArgs,
                            opts: Optional[ResourceOptions] = None)
func NewGuestDiagnosticsSetting(ctx *Context, name string, args GuestDiagnosticsSettingArgs, opts ...ResourceOption) (*GuestDiagnosticsSetting, error)
public GuestDiagnosticsSetting(string name, GuestDiagnosticsSettingArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args GuestDiagnosticsSettingArgs
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 GuestDiagnosticsSettingArgs
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 GuestDiagnosticsSettingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GuestDiagnosticsSettingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

ResourceGroupName string
The name of the resource group.
DataSources List<Pulumi.AzureNative.Insights.Inputs.DataSourceArgs>
the array of data source object which are configured to collect and send data
DiagnosticSettingsName string
The name of the diagnostic setting.
Location string
Resource location
OsType string
Operating system type for the configuration
ProxySetting string
Tags Dictionary<string, string>
Resource tags
ResourceGroupName string
The name of the resource group.
DataSources []DataSourceArgs
the array of data source object which are configured to collect and send data
DiagnosticSettingsName string
The name of the diagnostic setting.
Location string
Resource location
OsType string
Operating system type for the configuration
ProxySetting string
Tags map[string]string
Resource tags
resourceGroupName string
The name of the resource group.
dataSources DataSourceArgs[]
the array of data source object which are configured to collect and send data
diagnosticSettingsName string
The name of the diagnostic setting.
location string
Resource location
osType string
Operating system type for the configuration
proxySetting string
tags {[key: string]: string}
Resource tags
resource_group_name str
The name of the resource group.
data_sources Sequence[DataSourceArgs]
the array of data source object which are configured to collect and send data
diagnostic_settings_name str
The name of the diagnostic setting.
location str
Resource location
os_type str
Operating system type for the configuration
proxy_setting str
tags Mapping[str, str]
Resource tags

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
Azure resource name
Type string
Azure resource type
Id string
The provider-assigned unique ID for this managed resource.
Name string
Azure resource name
Type string
Azure resource type
id string
The provider-assigned unique ID for this managed resource.
name string
Azure resource name
type string
Azure resource type
id str
The provider-assigned unique ID for this managed resource.
name str
Azure resource name
type str
Azure resource type

Supporting Types

DataSource

DataSourceConfiguration

EventLogs []EventLogConfiguration
Windows event logs configuration.
PerfCounters []PerformanceCounterConfiguration
Performance counter configuration
Providers []EtwProviderConfiguration
ETW providers configuration
eventLogs EventLogConfiguration[]
Windows event logs configuration.
perfCounters PerformanceCounterConfiguration[]
Performance counter configuration
providers EtwProviderConfiguration[]
ETW providers configuration
event_logs Sequence[EventLogConfiguration]
Windows event logs configuration.
perf_counters Sequence[PerformanceCounterConfiguration]
Performance counter configuration
providers Sequence[EtwProviderConfiguration]
ETW providers configuration

DataSourceConfigurationResponse

EventLogs []EventLogConfigurationResponse
Windows event logs configuration.
PerfCounters []PerformanceCounterConfigurationResponse
Performance counter configuration
Providers []EtwProviderConfigurationResponse
ETW providers configuration
eventLogs EventLogConfigurationResponse[]
Windows event logs configuration.
perfCounters PerformanceCounterConfigurationResponse[]
Performance counter configuration
providers EtwProviderConfigurationResponse[]
ETW providers configuration

DataSourceResponse

EtwEventConfiguration

Id int
Name string
Filter string
Id int
Name string
Filter string
id number
name string
filter string
id int
name str
filter str

EtwEventConfigurationResponse

Id int
Name string
Filter string
Id int
Name string
Filter string
id number
name string
filter string
id int
name str
filter str

EtwProviderConfiguration

EtwProviderConfigurationResponse

EventLogConfiguration

LogName string
Filter string
LogName string
Filter string
logName string
filter string

EventLogConfigurationResponse

LogName string
Filter string
LogName string
Filter string
logName string
filter string

PerformanceCounterConfiguration

Name string
SamplingPeriod string
Instance string
Name string
SamplingPeriod string
Instance string
name string
samplingPeriod string
instance string

PerformanceCounterConfigurationResponse

Name string
SamplingPeriod string
Instance string
Name string
SamplingPeriod string
Instance string
name string
samplingPeriod string
instance string

SinkConfiguration

Kind string
Kind string
kind string
kind str

SinkConfigurationResponse

Kind string
Kind string
kind string
kind str

Import

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

$ pulumi import azure-native:insights:guestDiagnosticsSetting SampleDiagSetting /subscriptions/187f412d-1758-44d9-b052-169e2564721d/resourceGroups/Default-ResourceGroup/providers/microsoft.insights/guestDiagnosticSettings/SampleDiagSetting 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0