Module monitoring

@pulumi/azure > monitoring

class ActionGroup

extends CustomResource

Manages an Action Group within Azure Monitor.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
    name: "monitoring-resources",
});
const testActionGroup = new azure.monitoring.ActionGroup("test", {
    emailReceivers: [
        {
            emailAddress: "admin@contoso.com",
            name: "sendtoadmin",
        },
        {
            emailAddress: "devops@contoso.com",
            name: "sendtodevops",
        },
    ],
    name: "CriticalAlertsAction",
    resourceGroupName: testResourceGroup.name,
    shortName: "p0action",
    smsReceivers: [{
        countryCode: "1",
        name: "oncallmsg",
        phoneNumber: "1231231234",
    }],
    webhookReceivers: [{
        name: "callmyapiaswell",
        serviceUri: "http://example.com/alert",
    }],
});

constructor

new ActionGroup(name: string, args: ActionGroupArgs, opts?: pulumi.CustomResourceOptions)

Create a ActionGroup resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ActionGroupState, opts?: pulumi.CustomResourceOptions): ActionGroup

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property emailReceivers

public emailReceivers: pulumi.Output<{
    emailAddress: string;
    name: string;
}[] | undefined>;

One or more email_receiver blocks as defined below.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

Whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. Defaults to true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the webhook receiver. Names must be unique (case-insensitive) across all receivers within an action group.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the Action Group instance.

property shortName

public shortName: pulumi.Output<string>;

The short name of the action group. This will be used in SMS messages.

property smsReceivers

public smsReceivers: pulumi.Output<{
    countryCode: string;
    name: string;
    phoneNumber: string;
}[] | undefined>;

One or more sms_receiver blocks as defined below.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property webhookReceivers

public webhookReceivers: pulumi.Output<{
    name: string;
    serviceUri: string;
}[] | undefined>;

One or more webhook_receiver blocks as defined below.

class ActivityLogAlert

extends CustomResource

Manages an Activity Log Alert within Azure Monitor.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const mainResourceGroup = new azure.core.ResourceGroup("main", {
    location: "West US",
    name: "example-resources",
});
const mainActionGroup = new azure.monitoring.ActionGroup("main", {
    name: "example-actiongroup",
    resourceGroupName: mainResourceGroup.name,
    shortName: "p0action",
    webhookReceivers: [{
        name: "callmyapi",
        serviceUri: "http://example.com/alert",
    }],
});
const toMonitor = new azure.storage.Account("to_monitor", {
    accountReplicationType: "GRS",
    accountTier: "Standard",
    location: mainResourceGroup.location,
    name: "examplesa",
    resourceGroupName: mainResourceGroup.name,
});
const mainActivityLogAlert = new azure.monitoring.ActivityLogAlert("main", {
    actions: [{
        actionGroupId: mainActionGroup.id,
        webhookProperties: {
            from: "terraform",
        },
    }],
    criteria: {
        category: "Recommendation",
        operationName: "Microsoft.Storage/storageAccounts/write",
        resourceId: toMonitor.id,
    },
    description: "This alert will monitor a specific storage account updates.",
    name: "example-activitylogalert",
    resourceGroupName: mainResourceGroup.name,
    scopes: [mainResourceGroup.id],
});

constructor

new ActivityLogAlert(name: string, args: ActivityLogAlertArgs, opts?: pulumi.CustomResourceOptions)

Create a ActivityLogAlert resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ActivityLogAlertState, opts?: pulumi.CustomResourceOptions): ActivityLogAlert

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property actions

public actions: pulumi.Output<{
    actionGroupId: string;
    webhookProperties: {[key: string]: string};
}[] | undefined>;

One or more action blocks as defined below.

property criteria

public criteria: pulumi.Output<{
    caller: string;
    category: string;
    level: string;
    operationName: string;
    resourceGroup: string;
    resourceId: string;
    resourceProvider: string;
    resourceType: string;
    status: string;
    subStatus: string;
}>;

A criteria block as defined below.

property description

public description: pulumi.Output<string | undefined>;

The description of this activity log alert.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

Should this Activity Log Alert be enabled? Defaults to true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the activity log alert. Changing this forces a new resource to be created.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the activity log alert instance.

property scopes

public scopes: pulumi.Output<string[]>;

The Scope at which the Activity Log should be applied, for example a the Resource ID of a Subscription or a Resource (such as a Storage Account).

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class AlertRule

extends CustomResource

Manages a metric-based alert rule in Azure Monitor.

NOTE: This resource has been deprecated in favour of the azurerm_monitor_metric_alertrule resource and will be removed in the next major version of the AzureRM Provider. The new resource shares the same fields as this one, and information on migrating across can be found in this guide.

Example Usage (CPU Percentage of a virtual machine)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const test = new azure.monitoring.AlertRule("test", {
    aggregation: "Average",
    description: "An alert rule to watch the metric Percentage CPU",
    emailAction: {
        customEmails: ["some.user@example.com"],
        sendToServiceOwners: false,
    },
    enabled: true,
    location: azurerm_resource_group_test.location,
    metricName: "Percentage CPU",
    name: azurerm_virtual_machine_test.name.apply(name => `${name}-cpu`),
    operator: "GreaterThan",
    period: "PT5M",
    resourceGroupName: azurerm_resource_group_test.name,
    resourceId: azurerm_virtual_machine_test.id,
    threshold: 75,
    webhookAction: {
        properties: {
            acceptance_test: "true",
            severity: "incredible",
        },
        serviceUri: "https://example.com/some-url",
    },
});

Example Usage (Storage usage of a SQL Database)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const test = new azure.monitoring.AlertRule("test", {
    aggregation: "Maximum",
    description: "An alert rule to watch the metric Storage",
    emailAction: {
        customEmails: ["some.user@example.com"],
        sendToServiceOwners: false,
    },
    enabled: true,
    location: azurerm_resource_group_test.location,
    metricName: "storage",
    name: azurerm_sql_database_test.name.apply(name => `${name}-storage`),
    operator: "GreaterThan",
    period: "PT10M",
    resourceGroupName: azurerm_resource_group_test.name,
    resourceId: azurerm_sql_database_test.id,
    threshold: 1073741824,
    webhookAction: {
        properties: {
            acceptance_test: "true",
            severity: "incredible",
        },
        serviceUri: "https://example.com/some-url",
    },
});

constructor

new AlertRule(name: string, args: AlertRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a AlertRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AlertRuleState, opts?: pulumi.CustomResourceOptions): AlertRule

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property aggregation

public aggregation: pulumi.Output<string>;

Defines how the metric data is combined over time. Possible values are Average, Minimum, Maximum, Total, and Last.

property description

public description: pulumi.Output<string>;

A verbose description of the alert rule that will be included in the alert email.

property emailAction

public emailAction: pulumi.Output<{
    customEmails: string[];
    sendToServiceOwners: boolean;
}>;

A email_action block as defined below.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

If true, the alert rule is enabled. Defaults to true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property metricName

public metricName: pulumi.Output<string>;

The metric that defines what the rule monitors.

property name

public name: pulumi.Output<string>;

Specifies the name of the alert rule. Changing this forces a new resource to be created.

property operator

public operator: pulumi.Output<string>;

The operator used to compare the metric data and the threshold. Possible values are GreaterThan, GreaterThanOrEqual, LessThan, and LessThanOrEqual.

property period

public period: pulumi.Output<string>;

The period of time formatted in ISO 8601 duration format that is used to monitor the alert activity based on the threshold. The period must be between 5 minutes and 1 day.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the alert rule. Changing this forces a new resource to be created.

property resourceId

public resourceId: pulumi.Output<string>;

The ID of the resource monitored by the alert rule.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

property threshold

public threshold: pulumi.Output<number>;

The threshold value that activates the alert.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property webhookAction

public webhookAction: pulumi.Output<{
    properties: {[key: string]: string};
    serviceUri: string;
}>;

A webhook_action block as defined below.

class AutoscaleSetting

extends CustomResource

Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets, App Services and other scalable resources.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
    name: "autoscalingTest",
});
const testScaleSet = new azure.compute.ScaleSet("test", {});
const testAutoscaleSetting = new azure.monitoring.AutoscaleSetting("test", {
    location: testResourceGroup.location,
    name: "myAutoscaleSetting",
    notification: {
        email: {
            customEmails: ["admin@contoso.com"],
            sendToSubscriptionAdministrator: true,
            sendToSubscriptionCoAdministrator: true,
        },
    },
    profiles: [{
        capacity: {
            default: 1,
            maximum: 10,
            minimum: 1,
        },
        name: "defaultProfile",
        rules: [
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: testScaleSet.id,
                    operator: "GreaterThan",
                    statistic: "Average",
                    threshold: 75,
                    timeAggregation: "Average",
                    timeGrain: "PT1M",
                    timeWindow: "PT5M",
                },
                scaleAction: {
                    cooldown: "PT1M",
                    direction: "Increase",
                    type: "ChangeCount",
                    value: 1,
                },
            },
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: testScaleSet.id,
                    operator: "LessThan",
                    statistic: "Average",
                    threshold: 25,
                    timeAggregation: "Average",
                    timeGrain: "PT1M",
                    timeWindow: "PT5M",
                },
                scaleAction: {
                    cooldown: "PT1M",
                    direction: "Decrease",
                    type: "ChangeCount",
                    value: 1,
                },
            },
        ],
    }],
    resourceGroupName: testResourceGroup.name,
    targetResourceId: testScaleSet.id,
});

Example Usage (repeating on weekends)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
    name: "autoscalingTest",
});
const testScaleSet = new azure.compute.ScaleSet("test", {});
const testAutoscaleSetting = new azure.monitoring.AutoscaleSetting("test", {
    location: testResourceGroup.location,
    name: "myAutoscaleSetting",
    notification: {
        email: {
            customEmails: ["admin@contoso.com"],
            sendToSubscriptionAdministrator: true,
            sendToSubscriptionCoAdministrator: true,
        },
    },
    profiles: [{
        capacity: {
            default: 1,
            maximum: 10,
            minimum: 1,
        },
        name: "Weekends",
        recurrence: {
            days: [
                "Saturday",
                "Sunday",
            ],
            frequency: "Week",
            hours: 12,
            minutes: 0,
            timezone: "Pacific Standard Time",
        },
        rules: [
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: testScaleSet.id,
                    operator: "GreaterThan",
                    statistic: "Average",
                    threshold: 90,
                    timeAggregation: "Average",
                    timeGrain: "PT1M",
                    timeWindow: "PT5M",
                },
                scaleAction: {
                    cooldown: "PT1M",
                    direction: "Increase",
                    type: "ChangeCount",
                    value: 2,
                },
            },
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: testScaleSet.id,
                    operator: "LessThan",
                    statistic: "Average",
                    threshold: 10,
                    timeAggregation: "Average",
                    timeGrain: "PT1M",
                    timeWindow: "PT5M",
                },
                scaleAction: {
                    cooldown: "PT1M",
                    direction: "Decrease",
                    type: "ChangeCount",
                    value: 2,
                },
            },
        ],
    }],
    resourceGroupName: testResourceGroup.name,
    targetResourceId: testScaleSet.id,
});

Example Usage (for fixed dates)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West US",
    name: "autoscalingTest",
});
const testScaleSet = new azure.compute.ScaleSet("test", {});
const testAutoscaleSetting = new azure.monitoring.AutoscaleSetting("test", {
    enabled: true,
    location: testResourceGroup.location,
    name: "myAutoscaleSetting",
    notification: {
        email: {
            customEmails: ["admin@contoso.com"],
            sendToSubscriptionAdministrator: true,
            sendToSubscriptionCoAdministrator: true,
        },
    },
    profiles: [{
        capacity: {
            default: 1,
            maximum: 10,
            minimum: 1,
        },
        fixedDate: {
            end: "2020-07-31T23:59:59Z",
            start: "2020-07-01T00:00:00Z",
            timezone: "Pacific Standard Time",
        },
        name: "forJuly",
        rules: [
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: testScaleSet.id,
                    operator: "GreaterThan",
                    statistic: "Average",
                    threshold: 90,
                    timeAggregation: "Average",
                    timeGrain: "PT1M",
                    timeWindow: "PT5M",
                },
                scaleAction: {
                    cooldown: "PT1M",
                    direction: "Increase",
                    type: "ChangeCount",
                    value: 2,
                },
            },
            {
                metricTrigger: {
                    metricName: "Percentage CPU",
                    metricResourceId: testScaleSet.id,
                    operator: "LessThan",
                    statistic: "Average",
                    threshold: 10,
                    timeAggregation: "Average",
                    timeGrain: "PT1M",
                    timeWindow: "PT5M",
                },
                scaleAction: {
                    cooldown: "PT1M",
                    direction: "Decrease",
                    type: "ChangeCount",
                    value: 2,
                },
            },
        ],
    }],
    resourceGroupName: testResourceGroup.name,
    targetResourceId: testScaleSet.id,
});

constructor

new AutoscaleSetting(name: string, args: AutoscaleSettingArgs, opts?: pulumi.CustomResourceOptions)

Create a AutoscaleSetting resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AutoscaleSettingState, opts?: pulumi.CustomResourceOptions): AutoscaleSetting

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

The name of the AutoScale Setting. Changing this forces a new resource to be created.

property notification

public notification: pulumi.Output<{
    email: {
        customEmails: string[];
        sendToSubscriptionAdministrator: boolean;
        sendToSubscriptionCoAdministrator: boolean;
    };
    webhooks: {
        properties: {[key: string]: any};
        serviceUri: string;
    }[];
} | undefined>;

Specifies a notification block as defined below.

property profiles

public profiles: pulumi.Output<{
    capacity: {
        default: number;
        maximum: number;
        minimum: number;
    };
    fixedDate: {
        end: string;
        start: string;
        timezone: string;
    };
    name: string;
    recurrence: {
        days: string[];
        hours: number;
        minutes: number;
        timezone: string;
    };
    rules: {
        metricTrigger: {
            metricName: string;
            metricResourceId: string;
            operator: string;
            statistic: string;
            threshold: number;
            timeAggregation: string;
            timeGrain: string;
            timeWindow: string;
        };
        scaleAction: {
            cooldown: string;
            direction: string;
            type: string;
            value: number;
        };
    }[];
}[]>;

Specifies one or more (up to 20) profile blocks as defined below.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property targetResourceId

public targetResourceId: pulumi.Output<string>;

Specifies the resource ID of the resource that the autoscale setting should be added to.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class DiagnosticSetting

extends CustomResource

Manages a Diagnostic Setting for an existing Resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "West Europe",
    name: "example-resources",
});
const testKeyVault = testResourceGroup.name.apply(name => azure.keyvault.getKeyVault({
    name: "example-vault",
    resourceGroupName: name,
}));
const testAccount = testResourceGroup.name.apply(name => azure.storage.getAccount({
    name: "examplestoracc",
    resourceGroupName: name,
}));
const testDiagnosticSetting = new azure.monitoring.DiagnosticSetting("test", {
    logs: [{
        category: "AuditEvent",
        enabled: false,
        retentionPolicy: {
            enabled: false,
        },
    }],
    metrics: [{
        category: "AllMetrics",
        retentionPolicy: {
            enabled: false,
        },
    }],
    name: "example",
    storageAccountId: testAccount.apply(testAccount => testAccount.id),
    targetResourceId: testKeyVault.apply(testKeyVault => testKeyVault.id),
});

constructor

new DiagnosticSetting(name: string, args: DiagnosticSettingArgs, opts?: pulumi.CustomResourceOptions)

Create a DiagnosticSetting resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DiagnosticSettingState, opts?: pulumi.CustomResourceOptions): DiagnosticSetting

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property eventhubAuthorizationRuleId

public eventhubAuthorizationRuleId: pulumi.Output<string | undefined>;

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

property eventhubName

public eventhubName: pulumi.Output<string | undefined>;

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property logAnalyticsWorkspaceId

public logAnalyticsWorkspaceId: pulumi.Output<string | undefined>;

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

property logs

public logs: pulumi.Output<{
    category: string;
    enabled: boolean;
    retentionPolicy: {
        days: number;
        enabled: boolean;
    };
}[] | undefined>;

One or more log blocks as defined below.

property metrics

public metrics: pulumi.Output<{
    category: string;
    enabled: boolean;
    retentionPolicy: {
        days: number;
        enabled: boolean;
    };
}[] | undefined>;

One or more metric blocks as defined below.

property name

public name: pulumi.Output<string>;

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

property storageAccountId

public storageAccountId: pulumi.Output<string | undefined>;

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

property targetResourceId

public targetResourceId: pulumi.Output<string>;

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class LogProfile

extends CustomResource

Manages a Log Profile. A Log Profile configures how Activity Logs are exported.

NOTE: It’s only possible to configure one Log Profile per Subscription. If you are trying to create more than one Log Profile, an error with StatusCode=409 will occur.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "eastus",
    name: "logprofiletest-rg",
});
const testEventHubNamespace = new azure.eventhub.EventHubNamespace("test", {
    capacity: 2,
    location: testResourceGroup.location,
    name: "logprofileeventhub",
    resourceGroupName: testResourceGroup.name,
    sku: "Standard",
});
const testAccount = new azure.storage.Account("test", {
    accountReplicationType: "GRS",
    accountTier: "Standard",
    location: testResourceGroup.location,
    name: "afscsdfytw",
    resourceGroupName: testResourceGroup.name,
});
const testLogProfile = new azure.monitoring.LogProfile("test", {
    categories: [
        "Action",
        "Delete",
        "Write",
    ],
    locations: [
        "westus",
        "global",
    ],
    name: "default",
    retentionPolicy: {
        days: 7,
        enabled: true,
    },
    servicebusRuleId: testEventHubNamespace.id.apply(id => `${id}/authorizationrules/RootManageSharedAccessKey`),
    storageAccountId: testAccount.id,
});

constructor

new LogProfile(name: string, args: LogProfileArgs, opts?: pulumi.CustomResourceOptions)

Create a LogProfile resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LogProfileState, opts?: pulumi.CustomResourceOptions): LogProfile

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property categories

public categories: pulumi.Output<string[]>;

List of categories of the logs.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property locations

public locations: pulumi.Output<string[]>;

List of regions for which Activity Log events are stored or streamed.

property name

public name: pulumi.Output<string>;

The name of the Log Profile. Changing this forces a new resource to be created.

property retentionPolicy

public retentionPolicy: pulumi.Output<{
    days: number;
    enabled: boolean;
}>;

A retention_policy block as documented below. A retention policy for how long Activity Logs are retained in the storage account.

property servicebusRuleId

public servicebusRuleId: pulumi.Output<string | undefined>;

The service bus (or event hub) rule ID of the service bus (or event hub) namespace in which the Activity Log is streamed to. At least one of storage_account_id or servicebus_rule_id must be set.

property storageAccountId

public storageAccountId: pulumi.Output<string | undefined>;

The resource ID of the storage account in which the Activity Log is stored. At least one of storage_account_id or servicebus_rule_id must be set.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class MetricAlert

extends CustomResource

Manages a Metric Alert within Azure Monitor.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const mainResourceGroup = new azure.core.ResourceGroup("main", {
    location: "West US",
    name: "example-resources",
});
const mainActionGroup = new azure.monitoring.ActionGroup("main", {
    name: "example-actiongroup",
    resourceGroupName: mainResourceGroup.name,
    shortName: "exampleact",
    webhookReceivers: [{
        name: "callmyapi",
        serviceUri: "http://example.com/alert",
    }],
});
const toMonitor = new azure.storage.Account("to_monitor", {
    accountReplicationType: "LRS",
    accountTier: "Standard",
    location: mainResourceGroup.location,
    name: "examplestorageaccount",
    resourceGroupName: mainResourceGroup.name,
});
const test = new azure.monitoring.MetricAlert("test", {
    actions: [{
        actionGroupId: mainActionGroup.id,
    }],
    criterias: [{
        aggregation: "Total",
        dimensions: [{
            name: "ApiName",
            operator: "Include",
            values: ["*"],
        }],
        metricName: "Transactions",
        metricNamespace: "Microsoft.Storage/storageAccounts",
        operator: "GreaterThan",
        threshold: 50,
    }],
    description: "Action will be triggered when Transactions count is greater than 50.",
    name: "example-metricalert",
    resourceGroupName: mainResourceGroup.name,
    scopes: toMonitor.id,
});

constructor

new MetricAlert(name: string, args: MetricAlertArgs, opts?: pulumi.CustomResourceOptions)

Create a MetricAlert resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: MetricAlertState, opts?: pulumi.CustomResourceOptions): MetricAlert

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property actions

public actions: pulumi.Output<{
    actionGroupId: string;
    webhookProperties: {[key: string]: string};
}[] | undefined>;

One or more action blocks as defined below.

property autoMitigate

public autoMitigate: pulumi.Output<boolean | undefined>;

Should the alerts in this Metric Alert be auto resolved? Defaults to false.

property criterias

public criterias: pulumi.Output<{
    aggregation: string;
    dimensions: {
        name: string;
        operator: string;
        values: string[];
    }[];
    metricName: string;
    metricNamespace: string;
    operator: string;
    threshold: number;
}[]>;

One or more criteria blocks as defined below.

property description

public description: pulumi.Output<string | undefined>;

The description of this Metric Alert.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

Should this Metric Alert be enabled? Defaults to true.

property frequency

public frequency: pulumi.Output<string | undefined>;

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

The name of the Metric Alert. Changing this forces a new resource to be created.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the Metric Alert instance.

property scopes

public scopes: pulumi.Output<string>;

The resource ID at which the metric criteria should be applied.

property severity

public severity: pulumi.Output<number | undefined>;

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property windowSize

public windowSize: pulumi.Output<string | undefined>;

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

class MetricAlertRule

extends CustomResource

Manages a metric-based alert rule in Azure Monitor.

Example Usage (CPU Percentage of a virtual machine)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const test = new azure.monitoring.MetricAlertRule("test", {
    aggregation: "Average",
    description: "An alert rule to watch the metric Percentage CPU",
    emailAction: {
        customEmails: ["some.user@example.com"],
        sendToServiceOwners: false,
    },
    enabled: true,
    location: azurerm_resource_group_test.location,
    metricName: "Percentage CPU",
    name: azurerm_virtual_machine_test.name.apply(name => `${name}-cpu`),
    operator: "GreaterThan",
    period: "PT5M",
    resourceGroupName: azurerm_resource_group_test.name,
    resourceId: azurerm_virtual_machine_test.id,
    threshold: 75,
    webhookAction: {
        properties: {
            acceptance_test: "true",
            severity: "incredible",
        },
        serviceUri: "https://example.com/some-url",
    },
});

Example Usage (Storage usage of a SQL Database)

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const test = new azure.monitoring.MetricAlertRule("test", {
    aggregation: "Maximum",
    description: "An alert rule to watch the metric Storage",
    emailAction: {
        customEmails: ["some.user@example.com"],
        sendToServiceOwners: false,
    },
    enabled: true,
    location: azurerm_resource_group_test.location,
    metricName: "storage",
    name: azurerm_sql_database_test.name.apply(name => `${name}-storage`),
    operator: "GreaterThan",
    period: "PT10M",
    resourceGroupName: azurerm_resource_group_test.name,
    resourceId: azurerm_sql_database_test.id,
    threshold: 1073741824,
    webhookAction: {
        properties: {
            acceptance_test: "true",
            severity: "incredible",
        },
        serviceUri: "https://example.com/some-url",
    },
});

constructor

new MetricAlertRule(name: string, args: MetricAlertRuleArgs, opts?: pulumi.CustomResourceOptions)

Create a MetricAlertRule resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: MetricAlertRuleState, opts?: pulumi.CustomResourceOptions): MetricAlertRule

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property aggregation

public aggregation: pulumi.Output<string>;

Defines how the metric data is combined over time. Possible values are Average, Minimum, Maximum, Total, and Last.

property description

public description: pulumi.Output<string>;

A verbose description of the alert rule that will be included in the alert email.

property emailAction

public emailAction: pulumi.Output<{
    customEmails: string[];
    sendToServiceOwners: boolean;
}>;

A email_action block as defined below.

property enabled

public enabled: pulumi.Output<boolean | undefined>;

If true, the alert rule is enabled. Defaults to true.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property metricName

public metricName: pulumi.Output<string>;

The metric that defines what the rule monitors.

property name

public name: pulumi.Output<string>;

Specifies the name of the alert rule. Changing this forces a new resource to be created.

property operator

public operator: pulumi.Output<string>;

The operator used to compare the metric data and the threshold. Possible values are GreaterThan, GreaterThanOrEqual, LessThan, and LessThanOrEqual.

property period

public period: pulumi.Output<string>;

The period of time formatted in ISO 8601 duration format that is used to monitor the alert activity based on the threshold. The period must be between 5 minutes and 1 day.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the alert rule. Changing this forces a new resource to be created.

property resourceId

public resourceId: pulumi.Output<string>;

The ID of the resource monitored by the alert rule.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

property threshold

public threshold: pulumi.Output<number>;

The threshold value that activates the alert.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property webhookAction

public webhookAction: pulumi.Output<{
    properties: {[key: string]: string};
    serviceUri: string;
}>;

A webhook_action block as defined below.

function getActionGroup

getActionGroup(args: GetActionGroupArgs, opts?: pulumi.InvokeOptions): Promise<GetActionGroupResult>

Use this data source to access the properties of an Action Group.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = pulumi.output(azure.monitoring.getActionGroup({
    name: "tfex-actiongroup",
    resourceGroupName: "terraform-example-rg",
}));

export const actionGroupId = example.apply(example => example.id);

function getDiagnosticCategories

getDiagnosticCategories(args: GetDiagnosticCategoriesArgs, opts?: pulumi.InvokeOptions): Promise<GetDiagnosticCategoriesResult>

Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testKeyVault = pulumi.all([azurerm_key_vault_test.name, azurerm_key_vault_test.resourceGroupName]).apply(([name, resourceGroupName]) => azure.keyvault.getKeyVault({
    name: name,
    resourceGroupName: resourceGroupName,
}));
const testDiagnosticCategories = azurerm_key_vault_test.id.apply(id => azure.monitoring.getDiagnosticCategories({
    resourceId: id,
}));

function getLogProfile

getLogProfile(args: GetLogProfileArgs, opts?: pulumi.InvokeOptions): Promise<GetLogProfileResult>

Use this data source to access the properties of a Log Profile.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const test = pulumi.output(azure.monitoring.getLogProfile({
    name: "test-logprofile",
}));

export const logProfileStorageAccountId = test.apply(test => test.storageAccountId);

interface ActionGroupArgs

The set of arguments for constructing a ActionGroup resource.

property emailReceivers

emailReceivers?: pulumi.Input<pulumi.Input<{
    emailAddress: pulumi.Input<string>;
    name: pulumi.Input<string>;
}>[]>;

One or more email_receiver blocks as defined below.

property enabled

enabled?: pulumi.Input<boolean>;

Whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. Defaults to true.

property name

name?: pulumi.Input<string>;

The name of the webhook receiver. Names must be unique (case-insensitive) across all receivers within an action group.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the Action Group instance.

property shortName

shortName: pulumi.Input<string>;

The short name of the action group. This will be used in SMS messages.

property smsReceivers

smsReceivers?: pulumi.Input<pulumi.Input<{
    countryCode: pulumi.Input<string>;
    name: pulumi.Input<string>;
    phoneNumber: pulumi.Input<string>;
}>[]>;

One or more sms_receiver blocks as defined below.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property webhookReceivers

webhookReceivers?: pulumi.Input<pulumi.Input<{
    name: pulumi.Input<string>;
    serviceUri: pulumi.Input<string>;
}>[]>;

One or more webhook_receiver blocks as defined below.

interface ActionGroupState

Input properties used for looking up and filtering ActionGroup resources.

property emailReceivers

emailReceivers?: pulumi.Input<pulumi.Input<{
    emailAddress: pulumi.Input<string>;
    name: pulumi.Input<string>;
}>[]>;

One or more email_receiver blocks as defined below.

property enabled

enabled?: pulumi.Input<boolean>;

Whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. Defaults to true.

property name

name?: pulumi.Input<string>;

The name of the webhook receiver. Names must be unique (case-insensitive) across all receivers within an action group.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the Action Group instance.

property shortName

shortName?: pulumi.Input<string>;

The short name of the action group. This will be used in SMS messages.

property smsReceivers

smsReceivers?: pulumi.Input<pulumi.Input<{
    countryCode: pulumi.Input<string>;
    name: pulumi.Input<string>;
    phoneNumber: pulumi.Input<string>;
}>[]>;

One or more sms_receiver blocks as defined below.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property webhookReceivers

webhookReceivers?: pulumi.Input<pulumi.Input<{
    name: pulumi.Input<string>;
    serviceUri: pulumi.Input<string>;
}>[]>;

One or more webhook_receiver blocks as defined below.

interface ActivityLogAlertArgs

The set of arguments for constructing a ActivityLogAlert resource.

property actions

actions?: pulumi.Input<pulumi.Input<{
    actionGroupId: pulumi.Input<string>;
    webhookProperties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
}>[]>;

One or more action blocks as defined below.

property criteria

criteria: pulumi.Input<{
    caller: pulumi.Input<string>;
    category: pulumi.Input<string>;
    level: pulumi.Input<string>;
    operationName: pulumi.Input<string>;
    resourceGroup: pulumi.Input<string>;
    resourceId: pulumi.Input<string>;
    resourceProvider: pulumi.Input<string>;
    resourceType: pulumi.Input<string>;
    status: pulumi.Input<string>;
    subStatus: pulumi.Input<string>;
}>;

A criteria block as defined below.

property description

description?: pulumi.Input<string>;

The description of this activity log alert.

property enabled

enabled?: pulumi.Input<boolean>;

Should this Activity Log Alert be enabled? Defaults to true.

property name

name?: pulumi.Input<string>;

The name of the activity log alert. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the activity log alert instance.

property scopes

scopes: pulumi.Input<pulumi.Input<string>[]>;

The Scope at which the Activity Log should be applied, for example a the Resource ID of a Subscription or a Resource (such as a Storage Account).

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface ActivityLogAlertState

Input properties used for looking up and filtering ActivityLogAlert resources.

property actions

actions?: pulumi.Input<pulumi.Input<{
    actionGroupId: pulumi.Input<string>;
    webhookProperties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
}>[]>;

One or more action blocks as defined below.

property criteria

criteria?: pulumi.Input<{
    caller: pulumi.Input<string>;
    category: pulumi.Input<string>;
    level: pulumi.Input<string>;
    operationName: pulumi.Input<string>;
    resourceGroup: pulumi.Input<string>;
    resourceId: pulumi.Input<string>;
    resourceProvider: pulumi.Input<string>;
    resourceType: pulumi.Input<string>;
    status: pulumi.Input<string>;
    subStatus: pulumi.Input<string>;
}>;

A criteria block as defined below.

property description

description?: pulumi.Input<string>;

The description of this activity log alert.

property enabled

enabled?: pulumi.Input<boolean>;

Should this Activity Log Alert be enabled? Defaults to true.

property name

name?: pulumi.Input<string>;

The name of the activity log alert. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the activity log alert instance.

property scopes

scopes?: pulumi.Input<pulumi.Input<string>[]>;

The Scope at which the Activity Log should be applied, for example a the Resource ID of a Subscription or a Resource (such as a Storage Account).

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface AlertRuleArgs

The set of arguments for constructing a AlertRule resource.

property aggregation

aggregation: pulumi.Input<string>;

Defines how the metric data is combined over time. Possible values are Average, Minimum, Maximum, Total, and Last.

property description

description?: pulumi.Input<string>;

A verbose description of the alert rule that will be included in the alert email.

property emailAction

emailAction?: pulumi.Input<{
    customEmails: pulumi.Input<pulumi.Input<string>[]>;
    sendToServiceOwners: pulumi.Input<boolean>;
}>;

A email_action block as defined below.

property enabled

enabled?: pulumi.Input<boolean>;

If true, the alert rule is enabled. Defaults to true.

property location

location: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property metricName

metricName: pulumi.Input<string>;

The metric that defines what the rule monitors.

property name

name?: pulumi.Input<string>;

Specifies the name of the alert rule. Changing this forces a new resource to be created.

property operator

operator: pulumi.Input<string>;

The operator used to compare the metric data and the threshold. Possible values are GreaterThan, GreaterThanOrEqual, LessThan, and LessThanOrEqual.

property period

period: pulumi.Input<string>;

The period of time formatted in ISO 8601 duration format that is used to monitor the alert activity based on the threshold. The period must be between 5 minutes and 1 day.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the alert rule. Changing this forces a new resource to be created.

property resourceId

resourceId: pulumi.Input<string>;

The ID of the resource monitored by the alert rule.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

property threshold

threshold: pulumi.Input<number>;

The threshold value that activates the alert.

property webhookAction

webhookAction?: pulumi.Input<{
    properties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    serviceUri: pulumi.Input<string>;
}>;

A webhook_action block as defined below.

interface AlertRuleState

Input properties used for looking up and filtering AlertRule resources.

property aggregation

aggregation?: pulumi.Input<string>;

Defines how the metric data is combined over time. Possible values are Average, Minimum, Maximum, Total, and Last.

property description

description?: pulumi.Input<string>;

A verbose description of the alert rule that will be included in the alert email.

property emailAction

emailAction?: pulumi.Input<{
    customEmails: pulumi.Input<pulumi.Input<string>[]>;
    sendToServiceOwners: pulumi.Input<boolean>;
}>;

A email_action block as defined below.

property enabled

enabled?: pulumi.Input<boolean>;

If true, the alert rule is enabled. Defaults to true.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property metricName

metricName?: pulumi.Input<string>;

The metric that defines what the rule monitors.

property name

name?: pulumi.Input<string>;

Specifies the name of the alert rule. Changing this forces a new resource to be created.

property operator

operator?: pulumi.Input<string>;

The operator used to compare the metric data and the threshold. Possible values are GreaterThan, GreaterThanOrEqual, LessThan, and LessThanOrEqual.

property period

period?: pulumi.Input<string>;

The period of time formatted in ISO 8601 duration format that is used to monitor the alert activity based on the threshold. The period must be between 5 minutes and 1 day.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the alert rule. Changing this forces a new resource to be created.

property resourceId

resourceId?: pulumi.Input<string>;

The ID of the resource monitored by the alert rule.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

property threshold

threshold?: pulumi.Input<number>;

The threshold value that activates the alert.

property webhookAction

webhookAction?: pulumi.Input<{
    properties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    serviceUri: pulumi.Input<string>;
}>;

A webhook_action block as defined below.

interface AutoscaleSettingArgs

The set of arguments for constructing a AutoscaleSetting resource.

property enabled

enabled?: pulumi.Input<boolean>;

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

property location

location: pulumi.Input<string>;

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the AutoScale Setting. Changing this forces a new resource to be created.

property notification

notification?: pulumi.Input<{
    email: pulumi.Input<{
        customEmails: pulumi.Input<pulumi.Input<string>[]>;
        sendToSubscriptionAdministrator: pulumi.Input<boolean>;
        sendToSubscriptionCoAdministrator: pulumi.Input<boolean>;
    }>;
    webhooks: pulumi.Input<pulumi.Input<{
        properties: pulumi.Input<{[key: string]: any}>;
        serviceUri: pulumi.Input<string>;
    }>[]>;
}>;

Specifies a notification block as defined below.

property profiles

profiles: pulumi.Input<pulumi.Input<{
    capacity: pulumi.Input<{
        default: pulumi.Input<number>;
        maximum: pulumi.Input<number>;
        minimum: pulumi.Input<number>;
    }>;
    fixedDate: pulumi.Input<{
        end: pulumi.Input<string>;
        start: pulumi.Input<string>;
        timezone: pulumi.Input<string>;
    }>;
    name: pulumi.Input<string>;
    recurrence: pulumi.Input<{
        days: pulumi.Input<pulumi.Input<string>[]>;
        hours: pulumi.Input<number>;
        minutes: pulumi.Input<number>;
        timezone: pulumi.Input<string>;
    }>;
    rules: pulumi.Input<pulumi.Input<{
        metricTrigger: pulumi.Input<{
            metricName: pulumi.Input<string>;
            metricResourceId: pulumi.Input<string>;
            operator: pulumi.Input<string>;
            statistic: pulumi.Input<string>;
            threshold: pulumi.Input<number>;
            timeAggregation: pulumi.Input<string>;
            timeGrain: pulumi.Input<string>;
            timeWindow: pulumi.Input<string>;
        }>;
        scaleAction: pulumi.Input<{
            cooldown: pulumi.Input<string>;
            direction: pulumi.Input<string>;
            type: pulumi.Input<string>;
            value: pulumi.Input<number>;
        }>;
    }>[]>;
}>[]>;

Specifies one or more (up to 20) profile blocks as defined below.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property targetResourceId

targetResourceId: pulumi.Input<string>;

Specifies the resource ID of the resource that the autoscale setting should be added to.

interface AutoscaleSettingState

Input properties used for looking up and filtering AutoscaleSetting resources.

property enabled

enabled?: pulumi.Input<boolean>;

Specifies whether automatic scaling is enabled for the target resource. Defaults to true.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the AutoScale Setting should exist. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the AutoScale Setting. Changing this forces a new resource to be created.

property notification

notification?: pulumi.Input<{
    email: pulumi.Input<{
        customEmails: pulumi.Input<pulumi.Input<string>[]>;
        sendToSubscriptionAdministrator: pulumi.Input<boolean>;
        sendToSubscriptionCoAdministrator: pulumi.Input<boolean>;
    }>;
    webhooks: pulumi.Input<pulumi.Input<{
        properties: pulumi.Input<{[key: string]: any}>;
        serviceUri: pulumi.Input<string>;
    }>[]>;
}>;

Specifies a notification block as defined below.

property profiles

profiles?: pulumi.Input<pulumi.Input<{
    capacity: pulumi.Input<{
        default: pulumi.Input<number>;
        maximum: pulumi.Input<number>;
        minimum: pulumi.Input<number>;
    }>;
    fixedDate: pulumi.Input<{
        end: pulumi.Input<string>;
        start: pulumi.Input<string>;
        timezone: pulumi.Input<string>;
    }>;
    name: pulumi.Input<string>;
    recurrence: pulumi.Input<{
        days: pulumi.Input<pulumi.Input<string>[]>;
        hours: pulumi.Input<number>;
        minutes: pulumi.Input<number>;
        timezone: pulumi.Input<string>;
    }>;
    rules: pulumi.Input<pulumi.Input<{
        metricTrigger: pulumi.Input<{
            metricName: pulumi.Input<string>;
            metricResourceId: pulumi.Input<string>;
            operator: pulumi.Input<string>;
            statistic: pulumi.Input<string>;
            threshold: pulumi.Input<number>;
            timeAggregation: pulumi.Input<string>;
            timeGrain: pulumi.Input<string>;
            timeWindow: pulumi.Input<string>;
        }>;
        scaleAction: pulumi.Input<{
            cooldown: pulumi.Input<string>;
            direction: pulumi.Input<string>;
            type: pulumi.Input<string>;
            value: pulumi.Input<number>;
        }>;
    }>[]>;
}>[]>;

Specifies one or more (up to 20) profile blocks as defined below.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the Resource Group in the AutoScale Setting should be created. Changing this forces a new resource to be created.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property targetResourceId

targetResourceId?: pulumi.Input<string>;

Specifies the resource ID of the resource that the autoscale setting should be added to.

interface DiagnosticSettingArgs

The set of arguments for constructing a DiagnosticSetting resource.

property eventhubAuthorizationRuleId

eventhubAuthorizationRuleId?: pulumi.Input<string>;

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

property eventhubName

eventhubName?: pulumi.Input<string>;

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

property logAnalyticsWorkspaceId

logAnalyticsWorkspaceId?: pulumi.Input<string>;

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

property logs

logs?: pulumi.Input<pulumi.Input<{
    category: pulumi.Input<string>;
    enabled: pulumi.Input<boolean>;
    retentionPolicy: pulumi.Input<{
        days: pulumi.Input<number>;
        enabled: pulumi.Input<boolean>;
    }>;
}>[]>;

One or more log blocks as defined below.

property metrics

metrics?: pulumi.Input<pulumi.Input<{
    category: pulumi.Input<string>;
    enabled: pulumi.Input<boolean>;
    retentionPolicy: pulumi.Input<{
        days: pulumi.Input<number>;
        enabled: pulumi.Input<boolean>;
    }>;
}>[]>;

One or more metric blocks as defined below.

property name

name?: pulumi.Input<string>;

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

property storageAccountId

storageAccountId?: pulumi.Input<string>;

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

property targetResourceId

targetResourceId: pulumi.Input<string>;

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

interface DiagnosticSettingState

Input properties used for looking up and filtering DiagnosticSetting resources.

property eventhubAuthorizationRuleId

eventhubAuthorizationRuleId?: pulumi.Input<string>;

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data. Changing this forces a new resource to be created.

property eventhubName

eventhubName?: pulumi.Input<string>;

Specifies the name of the Event Hub where Diagnostics Data should be sent. Changing this forces a new resource to be created.

property logAnalyticsWorkspaceId

logAnalyticsWorkspaceId?: pulumi.Input<string>;

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent. Changing this forces a new resource to be created.

property logs

logs?: pulumi.Input<pulumi.Input<{
    category: pulumi.Input<string>;
    enabled: pulumi.Input<boolean>;
    retentionPolicy: pulumi.Input<{
        days: pulumi.Input<number>;
        enabled: pulumi.Input<boolean>;
    }>;
}>[]>;

One or more log blocks as defined below.

property metrics

metrics?: pulumi.Input<pulumi.Input<{
    category: pulumi.Input<string>;
    enabled: pulumi.Input<boolean>;
    retentionPolicy: pulumi.Input<{
        days: pulumi.Input<number>;
        enabled: pulumi.Input<boolean>;
    }>;
}>[]>;

One or more metric blocks as defined below.

property name

name?: pulumi.Input<string>;

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

property storageAccountId

storageAccountId?: pulumi.Input<string>;

With this parameter you can specify a storage account which should be used to send the logs to. Parameter must be a valid Azure Resource ID. Changing this forces a new resource to be created.

property targetResourceId

targetResourceId?: pulumi.Input<string>;

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.

interface GetActionGroupArgs

A collection of arguments for invoking getActionGroup.

property name

name: string;

Specifies the name of the Action Group.

property resourceGroupName

resourceGroupName: string;

Specifies the name of the resource group the Action Group is located in.

interface GetActionGroupResult

A collection of values returned by getActionGroup.

property emailReceivers

emailReceivers: {
    emailAddress: string;
    name: string;
}[];

One or more email_receiver blocks as defined below.

property enabled

enabled: boolean;

Whether this action group is enabled.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property name

name: string;

The name of the webhook receiver.

property resourceGroupName

resourceGroupName: string;

property shortName

shortName: string;

The short name of the action group.

property smsReceivers

smsReceivers: {
    countryCode: string;
    name: string;
    phoneNumber: string;
}[];

One or more sms_receiver blocks as defined below.

property webhookReceivers

webhookReceivers: {
    name: string;
    serviceUri: string;
}[];

One or more webhook_receiver blocks as defined below.

interface GetDiagnosticCategoriesArgs

A collection of arguments for invoking getDiagnosticCategories.

property resourceId

resourceId: string;

The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.

interface GetDiagnosticCategoriesResult

A collection of values returned by getDiagnosticCategories.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property logs

logs: string[];

A list of the Log Categories supported for this Resource.

property metrics

metrics: string[];

A list of the Metric Categories supported for this Resource.

property resourceId

resourceId: string;

interface GetLogProfileArgs

A collection of arguments for invoking getLogProfile.

property name

name: string;

Specifies the Name of the Log Profile.

interface GetLogProfileResult

A collection of values returned by getLogProfile.

property categories

categories: string[];

List of categories of the logs.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property locations

locations: string[];

List of regions for which Activity Log events are stored or streamed.

property name

name: string;

property retentionPolicy

retentionPolicy: {
    days: number;
    enabled: boolean;
};

property servicebusRuleId

servicebusRuleId: string;

The service bus (or event hub) rule ID of the service bus (or event hub) namespace in which the Activity Log is streamed to.

property storageAccountId

storageAccountId: string;

The resource id of the storage account in which the Activity Log is stored.

interface LogProfileArgs

The set of arguments for constructing a LogProfile resource.

property categories

categories: pulumi.Input<pulumi.Input<string>[]>;

List of categories of the logs.

property locations

locations: pulumi.Input<pulumi.Input<string>[]>;

List of regions for which Activity Log events are stored or streamed.

property name

name?: pulumi.Input<string>;

The name of the Log Profile. Changing this forces a new resource to be created.

property retentionPolicy

retentionPolicy: pulumi.Input<{
    days: pulumi.Input<number>;
    enabled: pulumi.Input<boolean>;
}>;

A retention_policy block as documented below. A retention policy for how long Activity Logs are retained in the storage account.

property servicebusRuleId

servicebusRuleId?: pulumi.Input<string>;

The service bus (or event hub) rule ID of the service bus (or event hub) namespace in which the Activity Log is streamed to. At least one of storage_account_id or servicebus_rule_id must be set.

property storageAccountId

storageAccountId?: pulumi.Input<string>;

The resource ID of the storage account in which the Activity Log is stored. At least one of storage_account_id or servicebus_rule_id must be set.

interface LogProfileState

Input properties used for looking up and filtering LogProfile resources.

property categories

categories?: pulumi.Input<pulumi.Input<string>[]>;

List of categories of the logs.

property locations

locations?: pulumi.Input<pulumi.Input<string>[]>;

List of regions for which Activity Log events are stored or streamed.

property name

name?: pulumi.Input<string>;

The name of the Log Profile. Changing this forces a new resource to be created.

property retentionPolicy

retentionPolicy?: pulumi.Input<{
    days: pulumi.Input<number>;
    enabled: pulumi.Input<boolean>;
}>;

A retention_policy block as documented below. A retention policy for how long Activity Logs are retained in the storage account.

property servicebusRuleId

servicebusRuleId?: pulumi.Input<string>;

The service bus (or event hub) rule ID of the service bus (or event hub) namespace in which the Activity Log is streamed to. At least one of storage_account_id or servicebus_rule_id must be set.

property storageAccountId

storageAccountId?: pulumi.Input<string>;

The resource ID of the storage account in which the Activity Log is stored. At least one of storage_account_id or servicebus_rule_id must be set.

interface MetricAlertArgs

The set of arguments for constructing a MetricAlert resource.

property actions

actions?: pulumi.Input<pulumi.Input<{
    actionGroupId: pulumi.Input<string>;
    webhookProperties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
}>[]>;

One or more action blocks as defined below.

property autoMitigate

autoMitigate?: pulumi.Input<boolean>;

Should the alerts in this Metric Alert be auto resolved? Defaults to false.

property criterias

criterias: pulumi.Input<pulumi.Input<{
    aggregation: pulumi.Input<string>;
    dimensions: pulumi.Input<pulumi.Input<{
        name: pulumi.Input<string>;
        operator: pulumi.Input<string>;
        values: pulumi.Input<pulumi.Input<string>[]>;
    }>[]>;
    metricName: pulumi.Input<string>;
    metricNamespace: pulumi.Input<string>;
    operator: pulumi.Input<string>;
    threshold: pulumi.Input<number>;
}>[]>;

One or more criteria blocks as defined below.

property description

description?: pulumi.Input<string>;

The description of this Metric Alert.

property enabled

enabled?: pulumi.Input<boolean>;

Should this Metric Alert be enabled? Defaults to true.

property frequency

frequency?: pulumi.Input<string>;

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

property name

name?: pulumi.Input<string>;

The name of the Metric Alert. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the Metric Alert instance.

property scopes

scopes: pulumi.Input<string>;

The resource ID at which the metric criteria should be applied.

property severity

severity?: pulumi.Input<number>;

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property windowSize

windowSize?: pulumi.Input<string>;

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.

interface MetricAlertRuleArgs

The set of arguments for constructing a MetricAlertRule resource.

property aggregation

aggregation: pulumi.Input<string>;

Defines how the metric data is combined over time. Possible values are Average, Minimum, Maximum, Total, and Last.

property description

description?: pulumi.Input<string>;

A verbose description of the alert rule that will be included in the alert email.

property emailAction

emailAction?: pulumi.Input<{
    customEmails: pulumi.Input<pulumi.Input<string>[]>;
    sendToServiceOwners: pulumi.Input<boolean>;
}>;

A email_action block as defined below.

property enabled

enabled?: pulumi.Input<boolean>;

If true, the alert rule is enabled. Defaults to true.

property location

location: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property metricName

metricName: pulumi.Input<string>;

The metric that defines what the rule monitors.

property name

name?: pulumi.Input<string>;

Specifies the name of the alert rule. Changing this forces a new resource to be created.

property operator

operator: pulumi.Input<string>;

The operator used to compare the metric data and the threshold. Possible values are GreaterThan, GreaterThanOrEqual, LessThan, and LessThanOrEqual.

property period

period: pulumi.Input<string>;

The period of time formatted in ISO 8601 duration format that is used to monitor the alert activity based on the threshold. The period must be between 5 minutes and 1 day.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the alert rule. Changing this forces a new resource to be created.

property resourceId

resourceId: pulumi.Input<string>;

The ID of the resource monitored by the alert rule.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

property threshold

threshold: pulumi.Input<number>;

The threshold value that activates the alert.

property webhookAction

webhookAction?: pulumi.Input<{
    properties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    serviceUri: pulumi.Input<string>;
}>;

A webhook_action block as defined below.

interface MetricAlertRuleState

Input properties used for looking up and filtering MetricAlertRule resources.

property aggregation

aggregation?: pulumi.Input<string>;

Defines how the metric data is combined over time. Possible values are Average, Minimum, Maximum, Total, and Last.

property description

description?: pulumi.Input<string>;

A verbose description of the alert rule that will be included in the alert email.

property emailAction

emailAction?: pulumi.Input<{
    customEmails: pulumi.Input<pulumi.Input<string>[]>;
    sendToServiceOwners: pulumi.Input<boolean>;
}>;

A email_action block as defined below.

property enabled

enabled?: pulumi.Input<boolean>;

If true, the alert rule is enabled. Defaults to true.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property metricName

metricName?: pulumi.Input<string>;

The metric that defines what the rule monitors.

property name

name?: pulumi.Input<string>;

Specifies the name of the alert rule. Changing this forces a new resource to be created.

property operator

operator?: pulumi.Input<string>;

The operator used to compare the metric data and the threshold. Possible values are GreaterThan, GreaterThanOrEqual, LessThan, and LessThanOrEqual.

property period

period?: pulumi.Input<string>;

The period of time formatted in ISO 8601 duration format that is used to monitor the alert activity based on the threshold. The period must be between 5 minutes and 1 day.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the alert rule. Changing this forces a new resource to be created.

property resourceId

resourceId?: pulumi.Input<string>;

The ID of the resource monitored by the alert rule.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource. Changing this forces a new resource to be created.

property threshold

threshold?: pulumi.Input<number>;

The threshold value that activates the alert.

property webhookAction

webhookAction?: pulumi.Input<{
    properties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    serviceUri: pulumi.Input<string>;
}>;

A webhook_action block as defined below.

interface MetricAlertState

Input properties used for looking up and filtering MetricAlert resources.

property actions

actions?: pulumi.Input<pulumi.Input<{
    actionGroupId: pulumi.Input<string>;
    webhookProperties: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
}>[]>;

One or more action blocks as defined below.

property autoMitigate

autoMitigate?: pulumi.Input<boolean>;

Should the alerts in this Metric Alert be auto resolved? Defaults to false.

property criterias

criterias?: pulumi.Input<pulumi.Input<{
    aggregation: pulumi.Input<string>;
    dimensions: pulumi.Input<pulumi.Input<{
        name: pulumi.Input<string>;
        operator: pulumi.Input<string>;
        values: pulumi.Input<pulumi.Input<string>[]>;
    }>[]>;
    metricName: pulumi.Input<string>;
    metricNamespace: pulumi.Input<string>;
    operator: pulumi.Input<string>;
    threshold: pulumi.Input<number>;
}>[]>;

One or more criteria blocks as defined below.

property description

description?: pulumi.Input<string>;

The description of this Metric Alert.

property enabled

enabled?: pulumi.Input<boolean>;

Should this Metric Alert be enabled? Defaults to true.

property frequency

frequency?: pulumi.Input<string>;

The evaluation frequency of this Metric Alert, represented in ISO 8601 duration format. Possible values are PT1M, PT5M, PT15M, PT30M and PT1H. Defaults to PT1M.

property name

name?: pulumi.Input<string>;

The name of the Metric Alert. Changing this forces a new resource to be created.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the Metric Alert instance.

property scopes

scopes?: pulumi.Input<string>;

The resource ID at which the metric criteria should be applied.

property severity

severity?: pulumi.Input<number>;

The severity of this Metric Alert. Possible values are 0, 1, 2, 3 and 4. Defaults to 3.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property windowSize

windowSize?: pulumi.Input<string>;

The period of time that is used to monitor alert activity, represented in ISO 8601 duration format. This value must be greater than frequency. Possible values are PT1M, PT5M, PT15M, PT30M, PT1H, PT6H, PT12H and P1D. Defaults to PT5M.