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

com.pulumi.azure.sentinel.kotlin.AlertRuleMsSecurityIncident.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.sentinel.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [AlertRuleMsSecurityIncident].
 */
@PulumiTagMarker
public class AlertRuleMsSecurityIncidentResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: AlertRuleMsSecurityIncidentArgs = AlertRuleMsSecurityIncidentArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend AlertRuleMsSecurityIncidentArgsBuilder.() -> Unit) {
        val builder = AlertRuleMsSecurityIncidentArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): AlertRuleMsSecurityIncident {
        val builtJavaResource =
            com.pulumi.azure.sentinel.AlertRuleMsSecurityIncident(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return AlertRuleMsSecurityIncident(builtJavaResource)
    }
}

/**
 * Manages a Sentinel MS Security Incident Alert Rule.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
 *     name: "example-workspace",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "PerGB2018",
 * });
 * const exampleLogAnalyticsWorkspaceOnboarding = new azure.sentinel.LogAnalyticsWorkspaceOnboarding("example", {workspaceId: exampleAnalyticsWorkspace.id});
 * const exampleAlertRuleMsSecurityIncident = new azure.sentinel.AlertRuleMsSecurityIncident("example", {
 *     name: "example-ms-security-incident-alert-rule",
 *     logAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.workspaceId,
 *     productFilter: "Microsoft Cloud App Security",
 *     displayName: "example rule",
 *     severityFilters: ["High"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("example",
 *     name="example-workspace",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku="PerGB2018")
 * example_log_analytics_workspace_onboarding = azure.sentinel.LogAnalyticsWorkspaceOnboarding("example", workspace_id=example_analytics_workspace.id)
 * example_alert_rule_ms_security_incident = azure.sentinel.AlertRuleMsSecurityIncident("example",
 *     name="example-ms-security-incident-alert-rule",
 *     log_analytics_workspace_id=example_log_analytics_workspace_onboarding.workspace_id,
 *     product_filter="Microsoft Cloud App Security",
 *     display_name="example rule",
 *     severity_filters=["High"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("example", new()
 *     {
 *         Name = "example-workspace",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = "PerGB2018",
 *     });
 *     var exampleLogAnalyticsWorkspaceOnboarding = new Azure.Sentinel.LogAnalyticsWorkspaceOnboarding("example", new()
 *     {
 *         WorkspaceId = exampleAnalyticsWorkspace.Id,
 *     });
 *     var exampleAlertRuleMsSecurityIncident = new Azure.Sentinel.AlertRuleMsSecurityIncident("example", new()
 *     {
 *         Name = "example-ms-security-incident-alert-rule",
 *         LogAnalyticsWorkspaceId = exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId,
 *         ProductFilter = "Microsoft Cloud App Security",
 *         DisplayName = "example rule",
 *         SeverityFilters = new[]
 *         {
 *             "High",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sentinel"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
 * 			Name:              pulumi.String("example-workspace"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku:               pulumi.String("PerGB2018"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleLogAnalyticsWorkspaceOnboarding, err := sentinel.NewLogAnalyticsWorkspaceOnboarding(ctx, "example", &sentinel.LogAnalyticsWorkspaceOnboardingArgs{
 * 			WorkspaceId: exampleAnalyticsWorkspace.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = sentinel.NewAlertRuleMsSecurityIncident(ctx, "example", &sentinel.AlertRuleMsSecurityIncidentArgs{
 * 			Name:                    pulumi.String("example-ms-security-incident-alert-rule"),
 * 			LogAnalyticsWorkspaceId: exampleLogAnalyticsWorkspaceOnboarding.WorkspaceId,
 * 			ProductFilter:           pulumi.String("Microsoft Cloud App Security"),
 * 			DisplayName:             pulumi.String("example rule"),
 * 			SeverityFilters: pulumi.StringArray{
 * 				pulumi.String("High"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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.operationalinsights.AnalyticsWorkspace;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
 * import com.pulumi.azure.sentinel.LogAnalyticsWorkspaceOnboarding;
 * import com.pulumi.azure.sentinel.LogAnalyticsWorkspaceOnboardingArgs;
 * import com.pulumi.azure.sentinel.AlertRuleMsSecurityIncident;
 * import com.pulumi.azure.sentinel.AlertRuleMsSecurityIncidentArgs;
 * 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()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
 *             .name("example-workspace")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku("PerGB2018")
 *             .build());
 *         var exampleLogAnalyticsWorkspaceOnboarding = new LogAnalyticsWorkspaceOnboarding("exampleLogAnalyticsWorkspaceOnboarding", LogAnalyticsWorkspaceOnboardingArgs.builder()
 *             .workspaceId(exampleAnalyticsWorkspace.id())
 *             .build());
 *         var exampleAlertRuleMsSecurityIncident = new AlertRuleMsSecurityIncident("exampleAlertRuleMsSecurityIncident", AlertRuleMsSecurityIncidentArgs.builder()
 *             .name("example-ms-security-incident-alert-rule")
 *             .logAnalyticsWorkspaceId(exampleLogAnalyticsWorkspaceOnboarding.workspaceId())
 *             .productFilter("Microsoft Cloud App Security")
 *             .displayName("example rule")
 *             .severityFilters("High")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleAnalyticsWorkspace:
 *     type: azure:operationalinsights:AnalyticsWorkspace
 *     name: example
 *     properties:
 *       name: example-workspace
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       sku: PerGB2018
 *   exampleLogAnalyticsWorkspaceOnboarding:
 *     type: azure:sentinel:LogAnalyticsWorkspaceOnboarding
 *     name: example
 *     properties:
 *       workspaceId: ${exampleAnalyticsWorkspace.id}
 *   exampleAlertRuleMsSecurityIncident:
 *     type: azure:sentinel:AlertRuleMsSecurityIncident
 *     name: example
 *     properties:
 *       name: example-ms-security-incident-alert-rule
 *       logAnalyticsWorkspaceId: ${exampleLogAnalyticsWorkspaceOnboarding.workspaceId}
 *       productFilter: Microsoft Cloud App Security
 *       displayName: example rule
 *       severityFilters:
 *         - High
 * ```
 * 
 * ## Import
 * Sentinel MS Security Incident Alert Rules can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:sentinel/alertRuleMsSecurityIncident:AlertRuleMsSecurityIncident example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/alertRules/rule1
 * ```
 */
public class AlertRuleMsSecurityIncident internal constructor(
    override val javaResource: com.pulumi.azure.sentinel.AlertRuleMsSecurityIncident,
) : KotlinCustomResource(javaResource, AlertRuleMsSecurityIncidentMapper) {
    /**
     * The GUID of the alert rule template which is used to create this Sentinel Scheduled Alert Rule. Changing this forces a new Sentinel MS Security Incident Alert Rule to be created.
     */
    public val alertRuleTemplateGuid: Output?
        get() = javaResource.alertRuleTemplateGuid().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The description of this Sentinel MS Security Incident Alert Rule.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The friendly name of this Sentinel MS Security Incident Alert Rule.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * Only create incidents when the alert display name doesn't contain text from this list.
     */
    public val displayNameExcludeFilters: Output>?
        get() = javaResource.displayNameExcludeFilters().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0 })
            }).orElse(null)
        })

    /**
     * Only create incidents when the alert display name contain text from this list, leave empty to apply no filter.
     */
    public val displayNameFilters: Output>
        get() = javaResource.displayNameFilters().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Should this Sentinel MS Security Incident Alert Rule be enabled? Defaults to `true`.
     */
    public val enabled: Output?
        get() = javaResource.enabled().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The ID of the Log Analytics Workspace this Sentinel MS Security Incident Alert Rule belongs to. Changing this forces a new Sentinel MS Security Incident Alert Rule to be created.
     */
    public val logAnalyticsWorkspaceId: Output
        get() = javaResource.logAnalyticsWorkspaceId().applyValue({ args0 -> args0 })

    /**
     * The name which should be used for this Sentinel MS Security Incident Alert Rule. Changing this forces a new Sentinel MS Security Incident Alert Rule to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The Microsoft Security Service from where the alert will be generated. Possible values are `Azure Active Directory Identity Protection`, `Azure Advanced Threat Protection`, `Azure Security Center`, `Azure Security Center for IoT`, `Microsoft Cloud App Security`, `Microsoft Defender Advanced Threat Protection` and `Office 365 Advanced Threat Protection`.
     */
    public val productFilter: Output
        get() = javaResource.productFilter().applyValue({ args0 -> args0 })

    /**
     * Only create incidents from alerts when alert severity level is contained in this list. Possible values are `High`, `Medium`, `Low` and `Informational`.
     * > **NOTE** At least one of the severity filters need to be set.
     */
    public val severityFilters: Output>
        get() = javaResource.severityFilters().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
}

public object AlertRuleMsSecurityIncidentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.sentinel.AlertRuleMsSecurityIncident::class == javaResource::class

    override fun map(javaResource: Resource): AlertRuleMsSecurityIncident =
        AlertRuleMsSecurityIncident(
            javaResource as
                com.pulumi.azure.sentinel.AlertRuleMsSecurityIncident,
        )
}

/**
 * @see [AlertRuleMsSecurityIncident].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [AlertRuleMsSecurityIncident].
 */
public suspend fun alertRuleMsSecurityIncident(
    name: String,
    block: suspend AlertRuleMsSecurityIncidentResourceBuilder.() -> Unit,
):
    AlertRuleMsSecurityIncident {
    val builder = AlertRuleMsSecurityIncidentResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [AlertRuleMsSecurityIncident].
 * @param name The _unique_ name of the resulting resource.
 */
public fun alertRuleMsSecurityIncident(name: String): AlertRuleMsSecurityIncident {
    val builder = AlertRuleMsSecurityIncidentResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy