
com.pulumi.azure.sentinel.kotlin.Metadata.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.sentinel.kotlin
import com.pulumi.azure.sentinel.kotlin.outputs.MetadataAuthor
import com.pulumi.azure.sentinel.kotlin.outputs.MetadataCategory
import com.pulumi.azure.sentinel.kotlin.outputs.MetadataSource
import com.pulumi.azure.sentinel.kotlin.outputs.MetadataSupport
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
import com.pulumi.azure.sentinel.kotlin.outputs.MetadataAuthor.Companion.toKotlin as metadataAuthorToKotlin
import com.pulumi.azure.sentinel.kotlin.outputs.MetadataCategory.Companion.toKotlin as metadataCategoryToKotlin
import com.pulumi.azure.sentinel.kotlin.outputs.MetadataSource.Companion.toKotlin as metadataSourceToKotlin
import com.pulumi.azure.sentinel.kotlin.outputs.MetadataSupport.Companion.toKotlin as metadataSupportToKotlin
/**
* Builder for [Metadata].
*/
@PulumiTagMarker
public class MetadataResourceBuilder internal constructor() {
public var name: String? = null
public var args: MetadataArgs = MetadataArgs()
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 MetadataArgsBuilder.() -> Unit) {
val builder = MetadataArgsBuilder()
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(): Metadata {
val builtJavaResource = com.pulumi.azure.sentinel.Metadata(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Metadata(builtJavaResource)
}
}
/**
* Manages a Sentinel Metadata.
* ## 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 exampleAnalyticsSolution = new azure.operationalinsights.AnalyticsSolution("example", {
* solutionName: "SecurityInsights",
* location: example.location,
* resourceGroupName: example.name,
* workspaceResourceId: exampleAnalyticsWorkspace.id,
* workspaceName: exampleAnalyticsWorkspace.name,
* plan: {
* publisher: "Microsoft",
* product: "OMSGallery/SecurityInsights",
* },
* });
* const exampleAlertRuleNrt = new azure.sentinel.AlertRuleNrt("example", {
* name: "example",
* logAnalyticsWorkspaceId: exampleAnalyticsSolution.workspaceResourceId,
* displayName: "example",
* severity: "High",
* query: `AzureActivity |
* where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" |
* where ActivityStatus == "Succeeded" |
* make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller
* `,
* });
* const exampleMetadata = new azure.sentinel.Metadata("example", {
* name: "exampl",
* workspaceId: exampleAnalyticsSolution.workspaceResourceId,
* contentId: exampleAlertRuleNrt.name,
* kind: "AnalyticsRule",
* parentId: exampleAlertRuleNrt.id,
* });
* ```
* ```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_analytics_solution = azure.operationalinsights.AnalyticsSolution("example",
* solution_name="SecurityInsights",
* location=example.location,
* resource_group_name=example.name,
* workspace_resource_id=example_analytics_workspace.id,
* workspace_name=example_analytics_workspace.name,
* plan=azure.operationalinsights.AnalyticsSolutionPlanArgs(
* publisher="Microsoft",
* product="OMSGallery/SecurityInsights",
* ))
* example_alert_rule_nrt = azure.sentinel.AlertRuleNrt("example",
* name="example",
* log_analytics_workspace_id=example_analytics_solution.workspace_resource_id,
* display_name="example",
* severity="High",
* query="""AzureActivity |
* where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" |
* where ActivityStatus == "Succeeded" |
* make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller
* """)
* example_metadata = azure.sentinel.Metadata("example",
* name="exampl",
* workspace_id=example_analytics_solution.workspace_resource_id,
* content_id=example_alert_rule_nrt.name,
* kind="AnalyticsRule",
* parent_id=example_alert_rule_nrt.id)
* ```
* ```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 exampleAnalyticsSolution = new Azure.OperationalInsights.AnalyticsSolution("example", new()
* {
* SolutionName = "SecurityInsights",
* Location = example.Location,
* ResourceGroupName = example.Name,
* WorkspaceResourceId = exampleAnalyticsWorkspace.Id,
* WorkspaceName = exampleAnalyticsWorkspace.Name,
* Plan = new Azure.OperationalInsights.Inputs.AnalyticsSolutionPlanArgs
* {
* Publisher = "Microsoft",
* Product = "OMSGallery/SecurityInsights",
* },
* });
* var exampleAlertRuleNrt = new Azure.Sentinel.AlertRuleNrt("example", new()
* {
* Name = "example",
* LogAnalyticsWorkspaceId = exampleAnalyticsSolution.WorkspaceResourceId,
* DisplayName = "example",
* Severity = "High",
* Query = @"AzureActivity |
* where OperationName == ""Create or Update Virtual Machine"" or OperationName ==""Create Deployment"" |
* where ActivityStatus == ""Succeeded"" |
* make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller
* ",
* });
* var exampleMetadata = new Azure.Sentinel.Metadata("example", new()
* {
* Name = "exampl",
* WorkspaceId = exampleAnalyticsSolution.WorkspaceResourceId,
* ContentId = exampleAlertRuleNrt.Name,
* Kind = "AnalyticsRule",
* ParentId = exampleAlertRuleNrt.Id,
* });
* });
* ```
* ```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
* }
* exampleAnalyticsSolution, err := operationalinsights.NewAnalyticsSolution(ctx, "example", &operationalinsights.AnalyticsSolutionArgs{
* SolutionName: pulumi.String("SecurityInsights"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* WorkspaceResourceId: exampleAnalyticsWorkspace.ID(),
* WorkspaceName: exampleAnalyticsWorkspace.Name,
* Plan: &operationalinsights.AnalyticsSolutionPlanArgs{
* Publisher: pulumi.String("Microsoft"),
* Product: pulumi.String("OMSGallery/SecurityInsights"),
* },
* })
* if err != nil {
* return err
* }
* exampleAlertRuleNrt, err := sentinel.NewAlertRuleNrt(ctx, "example", &sentinel.AlertRuleNrtArgs{
* Name: pulumi.String("example"),
* LogAnalyticsWorkspaceId: exampleAnalyticsSolution.WorkspaceResourceId,
* DisplayName: pulumi.String("example"),
* Severity: pulumi.String("High"),
* Query: pulumi.String("AzureActivity |\n where OperationName == \"Create or Update Virtual Machine\" or OperationName ==\"Create Deployment\" |\n where ActivityStatus == \"Succeeded\" |\n make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller\n"),
* })
* if err != nil {
* return err
* }
* _, err = sentinel.NewMetadata(ctx, "example", &sentinel.MetadataArgs{
* Name: pulumi.String("exampl"),
* WorkspaceId: exampleAnalyticsSolution.WorkspaceResourceId,
* ContentId: exampleAlertRuleNrt.Name,
* Kind: pulumi.String("AnalyticsRule"),
* ParentId: exampleAlertRuleNrt.ID(),
* })
* 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.operationalinsights.AnalyticsSolution;
* import com.pulumi.azure.operationalinsights.AnalyticsSolutionArgs;
* import com.pulumi.azure.operationalinsights.inputs.AnalyticsSolutionPlanArgs;
* import com.pulumi.azure.sentinel.AlertRuleNrt;
* import com.pulumi.azure.sentinel.AlertRuleNrtArgs;
* import com.pulumi.azure.sentinel.Metadata;
* import com.pulumi.azure.sentinel.MetadataArgs;
* 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 exampleAnalyticsSolution = new AnalyticsSolution("exampleAnalyticsSolution", AnalyticsSolutionArgs.builder()
* .solutionName("SecurityInsights")
* .location(example.location())
* .resourceGroupName(example.name())
* .workspaceResourceId(exampleAnalyticsWorkspace.id())
* .workspaceName(exampleAnalyticsWorkspace.name())
* .plan(AnalyticsSolutionPlanArgs.builder()
* .publisher("Microsoft")
* .product("OMSGallery/SecurityInsights")
* .build())
* .build());
* var exampleAlertRuleNrt = new AlertRuleNrt("exampleAlertRuleNrt", AlertRuleNrtArgs.builder()
* .name("example")
* .logAnalyticsWorkspaceId(exampleAnalyticsSolution.workspaceResourceId())
* .displayName("example")
* .severity("High")
* .query("""
* AzureActivity |
* where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" |
* where ActivityStatus == "Succeeded" |
* make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller
* """)
* .build());
* var exampleMetadata = new Metadata("exampleMetadata", MetadataArgs.builder()
* .name("exampl")
* .workspaceId(exampleAnalyticsSolution.workspaceResourceId())
* .contentId(exampleAlertRuleNrt.name())
* .kind("AnalyticsRule")
* .parentId(exampleAlertRuleNrt.id())
* .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
* exampleAnalyticsSolution:
* type: azure:operationalinsights:AnalyticsSolution
* name: example
* properties:
* solutionName: SecurityInsights
* location: ${example.location}
* resourceGroupName: ${example.name}
* workspaceResourceId: ${exampleAnalyticsWorkspace.id}
* workspaceName: ${exampleAnalyticsWorkspace.name}
* plan:
* publisher: Microsoft
* product: OMSGallery/SecurityInsights
* exampleAlertRuleNrt:
* type: azure:sentinel:AlertRuleNrt
* name: example
* properties:
* name: example
* logAnalyticsWorkspaceId: ${exampleAnalyticsSolution.workspaceResourceId}
* displayName: example
* severity: High
* query: |
* AzureActivity |
* where OperationName == "Create or Update Virtual Machine" or OperationName =="Create Deployment" |
* where ActivityStatus == "Succeeded" |
* make-series dcount(ResourceId) default=0 on EventSubmissionTimestamp in range(ago(7d), now(), 1d) by Caller
* exampleMetadata:
* type: azure:sentinel:Metadata
* name: example
* properties:
* name: exampl
* workspaceId: ${exampleAnalyticsSolution.workspaceResourceId}
* contentId: ${exampleAlertRuleNrt.name}
* kind: AnalyticsRule
* parentId: ${exampleAlertRuleNrt.id}
* ```
*
* ## Import
* Sentinel Metadata can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:sentinel/metadata:Metadata example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourcegroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/metadata/metadata1
* ```
*/
public class Metadata internal constructor(
override val javaResource: com.pulumi.azure.sentinel.Metadata,
) : KotlinCustomResource(javaResource, MetadataMapper) {
/**
* An `author` blocks as defined below.
*/
public val author: Output?
get() = javaResource.author().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
metadataAuthorToKotlin(args0)
})
}).orElse(null)
})
/**
* A `category` block as defined below.
*/
public val category: Output?
get() = javaResource.category().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
metadataCategoryToKotlin(args0)
})
}).orElse(null)
})
/**
* The ID of the content. Used to identify dependencies and content from solutions or community.
*/
public val contentId: Output
get() = javaResource.contentId().applyValue({ args0 -> args0 })
/**
* Schema version of the content. Can be used to distinguish between flow based on the schema version.
*/
public val contentSchemaVersion: Output?
get() = javaResource.contentSchemaVersion().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Custom version of the content.
*/
public val customVersion: Output?
get() = javaResource.customVersion().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A JSON formatted `dependency` block as defined below. Dependency for the content item, what other content items it requires to work.
*/
public val dependency: Output?
get() = javaResource.dependency().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The first publish date of solution content item.
*/
public val firstPublishDate: Output?
get() = javaResource.firstPublishDate().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of the icon, this id can be fetched from the solution template.
*/
public val iconId: Output?
get() = javaResource.iconId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The kind of content the metadata is for. Possible values are `AnalyticsRule`, `AnalyticsRuleTemplate`, `AutomationRule`, `AzureFunction`, `DataConnector`, `DataType`, `HuntingQuery`, `InvestigationQuery`, `LogicAppsCustomConnector`, `Parser`, `Playbook`, `PlaybookTemplate`, `Solution`, `Watchlist`, `WatchlistTemplate`, `Workbook` and `WorkbookTemplate`.
*/
public val kind: Output
get() = javaResource.kind().applyValue({ args0 -> args0 })
/**
* The last publish date of solution content item.
*/
public val lastPublishDate: Output?
get() = javaResource.lastPublishDate().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name which should be used for this Sentinel Metadata. Changing this forces a new Sentinel Metadata to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The ID of the parent resource ID of the content item, which the metadata belongs to.
*/
public val parentId: Output
get() = javaResource.parentId().applyValue({ args0 -> args0 })
/**
* Specifies a list of preview image file names. These will be taken from solution artifacts.
*/
public val previewImages: Output>?
get() = javaResource.previewImages().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* Specifies a list of preview image file names used for dark theme. These will be taken from solution artifacts.
*/
public val previewImagesDarks: Output>?
get() = javaResource.previewImagesDarks().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* Specifies a list of providers for the solution content item.
*/
public val providers: Output>?
get() = javaResource.providers().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0
})
}).orElse(null)
})
/**
* A `source` block as defined below.
*/
public val source: Output
get() = javaResource.source().applyValue({ args0 ->
args0.let({ args0 ->
metadataSourceToKotlin(args0)
})
})
/**
* A `support` block as defined below.
*/
public val support: Output?
get() = javaResource.support().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
metadataSupportToKotlin(args0)
})
}).orElse(null)
})
/**
* Specifies a list of tactics the resource covers. Possible values are `Reconnaissance`, `ResourceDevelopment`, `InitialAccess`, `Execution`, `Persistence`, `PrivilegeEscalation`, `DefenseEvasion`, `CredentialAccess`, `Discovery`, `LateralMovement`, `Collection`, `CommandAndControl`, `Exfiltration`, `Impact`, `ImpairProcessControl` and `InhibitResponseFunction`.
*/
public val threatAnalysisTactics: Output>?
get() = javaResource.threatAnalysisTactics().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* Specifies a list of techniques the resource covers.
*/
public val threatAnalysisTechniques: Output>?
get() = javaResource.threatAnalysisTechniques().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* Version of the content.
*/
public val version: Output?
get() = javaResource.version().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The ID of the Log Analytics Workspace. Changing this forces a new Sentinel Metadata to be created.
*/
public val workspaceId: Output
get() = javaResource.workspaceId().applyValue({ args0 -> args0 })
}
public object MetadataMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.sentinel.Metadata::class == javaResource::class
override fun map(javaResource: Resource): Metadata = Metadata(
javaResource as
com.pulumi.azure.sentinel.Metadata,
)
}
/**
* @see [Metadata].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Metadata].
*/
public suspend fun metadata(name: String, block: suspend MetadataResourceBuilder.() -> Unit):
Metadata {
val builder = MetadataResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Metadata].
* @param name The _unique_ name of the resulting resource.
*/
public fun metadata(name: String): Metadata {
val builder = MetadataResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy