All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.monitoring.ScheduledQueryRulesAlert Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.monitoring;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.monitoring.ScheduledQueryRulesAlertArgs;
import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesAlertState;
import com.pulumi.azure.monitoring.outputs.ScheduledQueryRulesAlertAction;
import com.pulumi.azure.monitoring.outputs.ScheduledQueryRulesAlertTrigger;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages an AlertingAction Scheduled Query Rules resource within Azure Monitor.
 * 
 * > **Warning** This resource is using an older AzureRM API version which is known to cause problems e.g. with custom webhook properties not included in triggered alerts. This resource is superseded by the azure.monitoring.ScheduledQueryRulesAlertV2 resource using newer API versions.
 * 
 * ## Import
 * 
 * Scheduled Query Rule Alerts can be imported using the `resource id`, e.g.
 * 
 * ```sh
 * $ pulumi import azure:monitoring/scheduledQueryRulesAlert:ScheduledQueryRulesAlert example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/scheduledQueryRules/myrulename
 * ```
 * 
 */
@ResourceType(type="azure:monitoring/scheduledQueryRulesAlert:ScheduledQueryRulesAlert")
public class ScheduledQueryRulesAlert extends com.pulumi.resources.CustomResource {
    /**
     * An `action` block as defined below.
     * 
     */
    @Export(name="action", refs={ScheduledQueryRulesAlertAction.class}, tree="[0]")
    private Output action;

    /**
     * @return An `action` block as defined below.
     * 
     */
    public Output action() {
        return this.action;
    }
    /**
     * List of Resource IDs referred into query.
     * 
     */
    @Export(name="authorizedResourceIds", refs={List.class,String.class}, tree="[0,1]")
    private Output> authorizedResourceIds;

    /**
     * @return List of Resource IDs referred into query.
     * 
     */
    public Output>> authorizedResourceIds() {
        return Codegen.optional(this.authorizedResourceIds);
    }
    /**
     * Should the alerts in this Metric Alert be auto resolved? Defaults to `false`.
     * > **NOTE** `auto_mitigation_enabled` and `throttling` are mutually exclusive and cannot both be set.
     * 
     */
    @Export(name="autoMitigationEnabled", refs={Boolean.class}, tree="[0]")
    private Output autoMitigationEnabled;

    /**
     * @return Should the alerts in this Metric Alert be auto resolved? Defaults to `false`.
     * > **NOTE** `auto_mitigation_enabled` and `throttling` are mutually exclusive and cannot both be set.
     * 
     */
    public Output> autoMitigationEnabled() {
        return Codegen.optional(this.autoMitigationEnabled);
    }
    /**
     * The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="dataSourceId", refs={String.class}, tree="[0]")
    private Output dataSourceId;

    /**
     * @return The resource URI over which log search query is to be run. Changing this forces a new resource to be created.
     * 
     */
    public Output dataSourceId() {
        return this.dataSourceId;
    }
    /**
     * The description of the scheduled query rule.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output description;

    /**
     * @return The description of the scheduled query rule.
     * 
     */
    public Output> description() {
        return Codegen.optional(this.description);
    }
    /**
     * Whether this scheduled query rule is enabled. Default is `true`.
     * 
     */
    @Export(name="enabled", refs={Boolean.class}, tree="[0]")
    private Output enabled;

    /**
     * @return Whether this scheduled query rule is enabled. Default is `true`.
     * 
     */
    public Output> enabled() {
        return Codegen.optional(this.enabled);
    }
    /**
     * Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
     * 
     */
    @Export(name="frequency", refs={Integer.class}, tree="[0]")
    private Output frequency;

    /**
     * @return Frequency (in minutes) at which rule condition should be evaluated. Values must be between 5 and 1440 (inclusive).
     * 
     */
    public Output frequency() {
        return this.frequency;
    }
    /**
     * Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output location;

    /**
     * @return Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.
     * 
     */
    public Output location() {
        return this.location;
    }
    /**
     * The name of the scheduled query rule. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output name;

    /**
     * @return The name of the scheduled query rule. Changing this forces a new resource to be created.
     * 
     */
    public Output name() {
        return this.name;
    }
    /**
     * Log search query.
     * 
     */
    @Export(name="query", refs={String.class}, tree="[0]")
    private Output query;

    /**
     * @return Log search query.
     * 
     */
    public Output query() {
        return this.query;
    }
    /**
     * The type of query results. Possible values are `ResultCount` and `Number`. Default is `ResultCount`. If set to `ResultCount`, `query` must include an `AggregatedValue` column of a numeric type, for example, `Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)`.
     * 
     */
    @Export(name="queryType", refs={String.class}, tree="[0]")
    private Output queryType;

    /**
     * @return The type of query results. Possible values are `ResultCount` and `Number`. Default is `ResultCount`. If set to `ResultCount`, `query` must include an `AggregatedValue` column of a numeric type, for example, `Heartbeat | summarize AggregatedValue = count() by bin(TimeGenerated, 5m)`.
     * 
     */
    public Output> queryType() {
        return Codegen.optional(this.queryType);
    }
    /**
     * The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output resourceGroupName;

    /**
     * @return The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.
     * 
     */
    public Output resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
     * 
     */
    @Export(name="severity", refs={Integer.class}, tree="[0]")
    private Output severity;

    /**
     * @return Severity of the alert. Possible values include: 0, 1, 2, 3, or 4.
     * 
     */
    public Output> severity() {
        return Codegen.optional(this.severity);
    }
    /**
     * A mapping of tags to assign to the resource.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output> tags;

    /**
     * @return A mapping of tags to assign to the resource.
     * 
     */
    public Output>> tags() {
        return Codegen.optional(this.tags);
    }
    /**
     * Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
     * 
     */
    @Export(name="throttling", refs={Integer.class}, tree="[0]")
    private Output throttling;

    /**
     * @return Time (in minutes) for which Alerts should be throttled or suppressed. Values must be between 0 and 10000 (inclusive).
     * 
     */
    public Output> throttling() {
        return Codegen.optional(this.throttling);
    }
    /**
     * Time window for which data needs to be fetched for query (must be greater than or equal to `frequency`). Values must be between 5 and 2880 (inclusive).
     * 
     */
    @Export(name="timeWindow", refs={Integer.class}, tree="[0]")
    private Output timeWindow;

    /**
     * @return Time window for which data needs to be fetched for query (must be greater than or equal to `frequency`). Values must be between 5 and 2880 (inclusive).
     * 
     */
    public Output timeWindow() {
        return this.timeWindow;
    }
    /**
     * A `trigger` block as defined below.
     * 
     */
    @Export(name="trigger", refs={ScheduledQueryRulesAlertTrigger.class}, tree="[0]")
    private Output trigger;

    /**
     * @return A `trigger` block as defined below.
     * 
     */
    public Output trigger() {
        return this.trigger;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public ScheduledQueryRulesAlert(java.lang.String name) {
        this(name, ScheduledQueryRulesAlertArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public ScheduledQueryRulesAlert(java.lang.String name, ScheduledQueryRulesAlertArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public ScheduledQueryRulesAlert(java.lang.String name, ScheduledQueryRulesAlertArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:monitoring/scheduledQueryRulesAlert:ScheduledQueryRulesAlert", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
    }

    private ScheduledQueryRulesAlert(java.lang.String name, Output id, @Nullable ScheduledQueryRulesAlertState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:monitoring/scheduledQueryRulesAlert:ScheduledQueryRulesAlert", name, state, makeResourceOptions(options, id), false);
    }

    private static ScheduledQueryRulesAlertArgs makeArgs(ScheduledQueryRulesAlertArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        if (options != null && options.getUrn().isPresent()) {
            return null;
        }
        return args == null ? ScheduledQueryRulesAlertArgs.Empty : args;
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static ScheduledQueryRulesAlert get(java.lang.String name, Output id, @Nullable ScheduledQueryRulesAlertState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new ScheduledQueryRulesAlert(name, id, state, options);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy