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

azure-native-v2.databasewatcher.AlertRuleResource

Explore with Pulumi AI

Concrete proxy resource types can be created by aliasing this type using a specific property type. Azure REST API version: 2024-07-19-preview.

Other available API versions: 2024-10-01-preview.

Example Usage

AlertRuleResources_CreateOrUpdate - generated by [MaximumSet] rule

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

return await Deployment.RunAsync(() => 
{
    var alertRuleResource = new AzureNative.DatabaseWatcher.AlertRuleResource("alertRuleResource", new()
    {
        AlertRuleResourceId = "/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo",
        AlertRuleResourceName = "testAlert",
        AlertRuleTemplateId = "someTemplateId",
        AlertRuleTemplateVersion = "1.0",
        CreatedWithProperties = AzureNative.DatabaseWatcher.AlertRuleCreationProperties.CreatedWithActionGroup,
        CreationTime = "2024-07-25T15:38:47.798Z",
        ResourceGroupName = "rgWatcher",
        WatcherName = "testWatcher",
    });

});
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := databasewatcher.NewAlertRuleResource(ctx, "alertRuleResource", &databasewatcher.AlertRuleResourceArgs{
			AlertRuleResourceId:      pulumi.String("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo"),
			AlertRuleResourceName:    pulumi.String("testAlert"),
			AlertRuleTemplateId:      pulumi.String("someTemplateId"),
			AlertRuleTemplateVersion: pulumi.String("1.0"),
			CreatedWithProperties:    pulumi.String(databasewatcher.AlertRuleCreationPropertiesCreatedWithActionGroup),
			CreationTime:             pulumi.String("2024-07-25T15:38:47.798Z"),
			ResourceGroupName:        pulumi.String("rgWatcher"),
			WatcherName:              pulumi.String("testWatcher"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.databasewatcher.AlertRuleResource;
import com.pulumi.azurenative.databasewatcher.AlertRuleResourceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var alertRuleResource = new AlertRuleResource("alertRuleResource", AlertRuleResourceArgs.builder()
            .alertRuleResourceId("/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo")
            .alertRuleResourceName("testAlert")
            .alertRuleTemplateId("someTemplateId")
            .alertRuleTemplateVersion("1.0")
            .createdWithProperties("CreatedWithActionGroup")
            .creationTime("2024-07-25T15:38:47.798Z")
            .resourceGroupName("rgWatcher")
            .watcherName("testWatcher")
            .build());

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

const alertRuleResource = new azure_native.databasewatcher.AlertRuleResource("alertRuleResource", {
    alertRuleResourceId: "/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo",
    alertRuleResourceName: "testAlert",
    alertRuleTemplateId: "someTemplateId",
    alertRuleTemplateVersion: "1.0",
    createdWithProperties: azure_native.databasewatcher.AlertRuleCreationProperties.CreatedWithActionGroup,
    creationTime: "2024-07-25T15:38:47.798Z",
    resourceGroupName: "rgWatcher",
    watcherName: "testWatcher",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

alert_rule_resource = azure_native.databasewatcher.AlertRuleResource("alertRuleResource",
    alert_rule_resource_id="/subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo",
    alert_rule_resource_name="testAlert",
    alert_rule_template_id="someTemplateId",
    alert_rule_template_version="1.0",
    created_with_properties=azure_native.databasewatcher.AlertRuleCreationProperties.CREATED_WITH_ACTION_GROUP,
    creation_time="2024-07-25T15:38:47.798Z",
    resource_group_name="rgWatcher",
    watcher_name="testWatcher")
Copy
resources:
  alertRuleResource:
    type: azure-native:databasewatcher:AlertRuleResource
    properties:
      alertRuleResourceId: /subscriptions/469DD77C-C8DB-47B7-B9E1-72D29F8C878Be/resourceGroups/rgWatcher/providers/microsoft.insights/scheduledqueryrules/alerts-demo
      alertRuleResourceName: testAlert
      alertRuleTemplateId: someTemplateId
      alertRuleTemplateVersion: '1.0'
      createdWithProperties: CreatedWithActionGroup
      creationTime: 2024-07-25T15:38:47.798Z
      resourceGroupName: rgWatcher
      watcherName: testWatcher
Copy

Create AlertRuleResource Resource

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

Constructor syntax

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

@overload
def AlertRuleResource(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      alert_rule_resource_id: Optional[str] = None,
                      alert_rule_template_id: Optional[str] = None,
                      alert_rule_template_version: Optional[str] = None,
                      created_with_properties: Optional[Union[str, AlertRuleCreationProperties]] = None,
                      creation_time: Optional[str] = None,
                      resource_group_name: Optional[str] = None,
                      watcher_name: Optional[str] = None,
                      alert_rule_resource_name: Optional[str] = None)
func NewAlertRuleResource(ctx *Context, name string, args AlertRuleResourceArgs, opts ...ResourceOption) (*AlertRuleResource, error)
public AlertRuleResource(string name, AlertRuleResourceArgs args, CustomResourceOptions? opts = null)
public AlertRuleResource(String name, AlertRuleResourceArgs args)
public AlertRuleResource(String name, AlertRuleResourceArgs args, CustomResourceOptions options)
type: azure-native:databasewatcher:AlertRuleResource
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

Constructor example

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

var alertRuleResourceResource = new AzureNative.Databasewatcher.AlertRuleResource("alertRuleResourceResource", new()
{
    AlertRuleResourceId = "string",
    AlertRuleTemplateId = "string",
    AlertRuleTemplateVersion = "string",
    CreatedWithProperties = "string",
    CreationTime = "string",
    ResourceGroupName = "string",
    WatcherName = "string",
    AlertRuleResourceName = "string",
});
Copy
example, err := databasewatcher.NewAlertRuleResource(ctx, "alertRuleResourceResource", &databasewatcher.AlertRuleResourceArgs{
	AlertRuleResourceId:      "string",
	AlertRuleTemplateId:      "string",
	AlertRuleTemplateVersion: "string",
	CreatedWithProperties:    "string",
	CreationTime:             "string",
	ResourceGroupName:        "string",
	WatcherName:              "string",
	AlertRuleResourceName:    "string",
})
Copy
var alertRuleResourceResource = new AlertRuleResource("alertRuleResourceResource", AlertRuleResourceArgs.builder()
    .alertRuleResourceId("string")
    .alertRuleTemplateId("string")
    .alertRuleTemplateVersion("string")
    .createdWithProperties("string")
    .creationTime("string")
    .resourceGroupName("string")
    .watcherName("string")
    .alertRuleResourceName("string")
    .build());
Copy
alert_rule_resource_resource = azure_native.databasewatcher.AlertRuleResource("alertRuleResourceResource",
    alert_rule_resource_id=string,
    alert_rule_template_id=string,
    alert_rule_template_version=string,
    created_with_properties=string,
    creation_time=string,
    resource_group_name=string,
    watcher_name=string,
    alert_rule_resource_name=string)
Copy
const alertRuleResourceResource = new azure_native.databasewatcher.AlertRuleResource("alertRuleResourceResource", {
    alertRuleResourceId: "string",
    alertRuleTemplateId: "string",
    alertRuleTemplateVersion: "string",
    createdWithProperties: "string",
    creationTime: "string",
    resourceGroupName: "string",
    watcherName: "string",
    alertRuleResourceName: "string",
});
Copy
type: azure-native:databasewatcher:AlertRuleResource
properties:
    alertRuleResourceId: string
    alertRuleResourceName: string
    alertRuleTemplateId: string
    alertRuleTemplateVersion: string
    createdWithProperties: string
    creationTime: string
    resourceGroupName: string
    watcherName: string
Copy

AlertRuleResource Resource Properties

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

Inputs

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

The AlertRuleResource resource accepts the following input properties:

AlertRuleResourceId This property is required. string
The resource ID of the alert rule resource.
AlertRuleTemplateId This property is required. string
The template ID associated with alert rule resource.
AlertRuleTemplateVersion This property is required. string
The alert rule template version.
CreatedWithProperties This property is required. string | Pulumi.AzureNative.DatabaseWatcher.AlertRuleCreationProperties
The properties with which the alert rule resource was created.
CreationTime This property is required. string
The creation time of the alert rule resource.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
WatcherName
This property is required.
Changes to this property will trigger replacement.
string
The database watcher name.
AlertRuleResourceName Changes to this property will trigger replacement. string
The alert rule proxy resource name.
AlertRuleResourceId This property is required. string
The resource ID of the alert rule resource.
AlertRuleTemplateId This property is required. string
The template ID associated with alert rule resource.
AlertRuleTemplateVersion This property is required. string
The alert rule template version.
CreatedWithProperties This property is required. string | AlertRuleCreationProperties
The properties with which the alert rule resource was created.
CreationTime This property is required. string
The creation time of the alert rule resource.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
WatcherName
This property is required.
Changes to this property will trigger replacement.
string
The database watcher name.
AlertRuleResourceName Changes to this property will trigger replacement. string
The alert rule proxy resource name.
alertRuleResourceId This property is required. String
The resource ID of the alert rule resource.
alertRuleTemplateId This property is required. String
The template ID associated with alert rule resource.
alertRuleTemplateVersion This property is required. String
The alert rule template version.
createdWithProperties This property is required. String | AlertRuleCreationProperties
The properties with which the alert rule resource was created.
creationTime This property is required. String
The creation time of the alert rule resource.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
watcherName
This property is required.
Changes to this property will trigger replacement.
String
The database watcher name.
alertRuleResourceName Changes to this property will trigger replacement. String
The alert rule proxy resource name.
alertRuleResourceId This property is required. string
The resource ID of the alert rule resource.
alertRuleTemplateId This property is required. string
The template ID associated with alert rule resource.
alertRuleTemplateVersion This property is required. string
The alert rule template version.
createdWithProperties This property is required. string | AlertRuleCreationProperties
The properties with which the alert rule resource was created.
creationTime This property is required. string
The creation time of the alert rule resource.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
watcherName
This property is required.
Changes to this property will trigger replacement.
string
The database watcher name.
alertRuleResourceName Changes to this property will trigger replacement. string
The alert rule proxy resource name.
alert_rule_resource_id This property is required. str
The resource ID of the alert rule resource.
alert_rule_template_id This property is required. str
The template ID associated with alert rule resource.
alert_rule_template_version This property is required. str
The alert rule template version.
created_with_properties This property is required. str | AlertRuleCreationProperties
The properties with which the alert rule resource was created.
creation_time This property is required. str
The creation time of the alert rule resource.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group. The name is case insensitive.
watcher_name
This property is required.
Changes to this property will trigger replacement.
str
The database watcher name.
alert_rule_resource_name Changes to this property will trigger replacement. str
The alert rule proxy resource name.
alertRuleResourceId This property is required. String
The resource ID of the alert rule resource.
alertRuleTemplateId This property is required. String
The template ID associated with alert rule resource.
alertRuleTemplateVersion This property is required. String
The alert rule template version.
createdWithProperties This property is required. String | "CreatedWithActionGroup" | "None"
The properties with which the alert rule resource was created.
creationTime This property is required. String
The creation time of the alert rule resource.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
watcherName
This property is required.
Changes to this property will trigger replacement.
String
The database watcher name.
alertRuleResourceName Changes to this property will trigger replacement. String
The alert rule proxy resource name.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
ProvisioningState string
The provisioning state of the alert rule resource.
SystemData Pulumi.AzureNative.DatabaseWatcher.Outputs.SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
ProvisioningState string
The provisioning state of the alert rule resource.
SystemData SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
provisioningState String
The provisioning state of the alert rule resource.
systemData SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the resource
provisioningState string
The provisioning state of the alert rule resource.
systemData SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the resource
provisioning_state str
The provisioning state of the alert rule resource.
system_data SystemDataResponse
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type str
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
provisioningState String
The provisioning state of the alert rule resource.
systemData Property Map
Azure Resource Manager metadata containing createdBy and modifiedBy information.
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Supporting Types

AlertRuleCreationProperties
, AlertRuleCreationPropertiesArgs

CreatedWithActionGroup
CreatedWithActionGroupThe alert rule was created with an action group.
None
NoneThe alert rule was created with no properties.
AlertRuleCreationPropertiesCreatedWithActionGroup
CreatedWithActionGroupThe alert rule was created with an action group.
AlertRuleCreationPropertiesNone
NoneThe alert rule was created with no properties.
CreatedWithActionGroup
CreatedWithActionGroupThe alert rule was created with an action group.
None
NoneThe alert rule was created with no properties.
CreatedWithActionGroup
CreatedWithActionGroupThe alert rule was created with an action group.
None
NoneThe alert rule was created with no properties.
CREATED_WITH_ACTION_GROUP
CreatedWithActionGroupThe alert rule was created with an action group.
NONE
NoneThe alert rule was created with no properties.
"CreatedWithActionGroup"
CreatedWithActionGroupThe alert rule was created with an action group.
"None"
NoneThe alert rule was created with no properties.

SystemDataResponse
, SystemDataResponseArgs

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

Import

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

$ pulumi import azure-native:databasewatcher:AlertRuleResource testAlert /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/alertRuleResources/{alertRuleResourceName} 
Copy

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

Package Details

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