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

com.pulumi.azurenative.alertsmanagement.ActionRuleByName Maven / Gradle / Ivy

There is a newer version: 2.72.0
Show newest version
// *** 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.azurenative.alertsmanagement;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.alertsmanagement.ActionRuleByNameArgs;
import com.pulumi.azurenative.alertsmanagement.outputs.ActionGroupResponse;
import com.pulumi.azurenative.alertsmanagement.outputs.DiagnosticsResponse;
import com.pulumi.azurenative.alertsmanagement.outputs.SuppressionResponse;
import com.pulumi.core.Alias;
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.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Action rule object containing target scope, conditions and suppression logic
 * Azure REST API version: 2019-05-05-preview. Prior API version in Azure Native 1.x: 2019-05-05-preview.
 * 
 * Other available API versions: 2018-11-02-privatepreview.
 * 
 * ## Example Usage
 * ### PutActionRule
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.alertsmanagement.ActionRuleByName;
 * import com.pulumi.azurenative.alertsmanagement.ActionRuleByNameArgs;
 * 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 actionRuleByName = new ActionRuleByName("actionRuleByName", ActionRuleByNameArgs.builder()
 *             .actionRuleName("DailySuppression")
 *             .location("Global")
 *             .properties(SuppressionArgs.builder()
 *                 .conditions(ConditionsArgs.builder()
 *                     .monitorCondition(ConditionArgs.builder()
 *                         .operator("Equals")
 *                         .values("Fired")
 *                         .build())
 *                     .monitorService(ConditionArgs.builder()
 *                         .operator("Equals")
 *                         .values(                        
 *                             "Platform",
 *                             "Application Insights")
 *                         .build())
 *                     .severity(ConditionArgs.builder()
 *                         .operator("Equals")
 *                         .values(                        
 *                             "Sev0",
 *                             "Sev2")
 *                         .build())
 *                     .targetResourceType(ConditionArgs.builder()
 *                         .operator("NotEquals")
 *                         .values("Microsoft.Compute/VirtualMachines")
 *                         .build())
 *                     .build())
 *                 .description("Action rule on resource group for daily suppression")
 *                 .scope(ScopeArgs.builder()
 *                     .scopeType("ResourceGroup")
 *                     .values("/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg")
 *                     .build())
 *                 .status("Enabled")
 *                 .suppressionConfig(SuppressionConfigArgs.builder()
 *                     .recurrenceType("Daily")
 *                     .schedule(SuppressionScheduleArgs.builder()
 *                         .endDate("12/18/2018")
 *                         .endTime("14:00:00")
 *                         .startDate("12/09/2018")
 *                         .startTime("06:00:00")
 *                         .build())
 *                     .build())
 *                 .type("Suppression")
 *                 .build())
 *             .resourceGroupName("alertscorrelationrg")
 *             .tags()
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:alertsmanagement:ActionRuleByName DailySuppression /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{actionRuleName} * ``` * */ @ResourceType(type="azure-native:alertsmanagement:ActionRuleByName") public class ActionRuleByName extends com.pulumi.resources.CustomResource { /** * Resource location * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Resource location * */ public Output location() { return this.location; } /** * Azure resource name * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Azure resource name * */ public Output name() { return this.name; } /** * action rule properties * */ @Export(name="properties", refs={Object.class}, tree="[0]") private Output properties; /** * @return action rule properties * */ public Output properties() { return this.properties; } /** * Resource tags * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Azure resource type * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Azure resource type * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public ActionRuleByName(java.lang.String name) { this(name, ActionRuleByNameArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ActionRuleByName(java.lang.String name, ActionRuleByNameArgs 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 ActionRuleByName(java.lang.String name, ActionRuleByNameArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:alertsmanagement:ActionRuleByName", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ActionRuleByName(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:alertsmanagement:ActionRuleByName", name, null, makeResourceOptions(options, id), false); } private static ActionRuleByNameArgs makeArgs(ActionRuleByNameArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ActionRuleByNameArgs.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()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:alertsmanagement/v20181102privatepreview:ActionRuleByName").build()), Output.of(Alias.builder().type("azure-native:alertsmanagement/v20190505preview:ActionRuleByName").build()), Output.of(Alias.builder().type("azure-native:alertsmanagement/v20210808:ActionRuleByName").build()), Output.of(Alias.builder().type("azure-native:alertsmanagement/v20210808preview:ActionRuleByName").build()), Output.of(Alias.builder().type("azure-native:alertsmanagement/v20230501preview:ActionRuleByName").build()), Output.of(Alias.builder().type("azure-native:alertsmanagement/v20240301preview:ActionRuleByName").build()) )) .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 options Optional settings to control the behavior of the CustomResource. */ public static ActionRuleByName get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ActionRuleByName(name, id, options); } }