ActivityLogAlert

class ActivityLogAlert : KotlinCustomResource

Manages an Activity Log Alert within Azure Monitor.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.monitoring.ActionGroup;
import com.pulumi.azure.monitoring.ActionGroupArgs;
import com.pulumi.azure.monitoring.inputs.ActionGroupWebhookReceiverArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.monitoring.ActivityLogAlert;
import com.pulumi.azure.monitoring.ActivityLogAlertArgs;
import com.pulumi.azure.monitoring.inputs.ActivityLogAlertCriteriaArgs;
import com.pulumi.azure.monitoring.inputs.ActivityLogAlertActionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var mainActionGroup = new ActionGroup("mainActionGroup", ActionGroupArgs.builder()
.resourceGroupName(example.name())
.shortName("p0action")
.webhookReceivers(ActionGroupWebhookReceiverArgs.builder()
.name("callmyapi")
.serviceUri("http://example.com/alert")
.build())
.build());
var toMonitor = new Account("toMonitor", AccountArgs.builder()
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountReplicationType("GRS")
.build());
var mainActivityLogAlert = new ActivityLogAlert("mainActivityLogAlert", ActivityLogAlertArgs.builder()
.resourceGroupName(example.name())
.scopes(example.id())
.description("This alert will monitor a specific storage account updates.")
.criteria(ActivityLogAlertCriteriaArgs.builder()
.resourceId(toMonitor.id())
.operationName("Microsoft.Storage/storageAccounts/write")
.category("Recommendation")
.build())
.actions(ActivityLogAlertActionArgs.builder()
.actionGroupId(mainActionGroup.id())
.webhookProperties(Map.of("from", "source"))
.build())
.build());
}
}

Import

Activity log alerts can be imported using the resource id, e.g.

$ pulumi import azure:monitoring/activityLogAlert:ActivityLogAlert example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/activityLogAlerts/myalertname

Properties

Link copied to clipboard

One or more action blocks as defined below.

Link copied to clipboard

A criteria block as defined below.

Link copied to clipboard
val description: Output<String>?

The description of this activity log alert.

Link copied to clipboard
val enabled: Output<Boolean>?

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

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

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard
val scopes: Output<List<String>>

The Scope at which the Activity Log should be applied. A list of strings which could be a resource group , or a subscription, or a resource ID (such as a Storage Account).

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>