Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.loganalytics.kotlin
import com.pulumi.azure.loganalytics.WorkspaceTableArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Manages a Table in a Log Analytics (formally Operational Insights) Workspace.
* > **Note:** This resource does not create or destroy tables. This resource is used to update attributes (currently only retention_in_days) of the tables created when a Log Analytics Workspace is created. Deleting an azure.loganalytics.WorkspaceTable resource will not delete the table. Instead, the table's retention_in_days field will be set to the value of azure.operationalinsights.AnalyticsWorkspace retention_in_days
* ## 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",
* location: example.location,
* resourceGroupName: example.name,
* sku: "PerGB2018",
* retentionInDays: 30,
* });
* const exampleWorkspaceTable = new azure.loganalytics.WorkspaceTable("example", {
* workspaceId: exampleAnalyticsWorkspace.id,
* name: "AppMetrics",
* retentionInDays: 60,
* totalRetentionInDays: 180,
* });
* ```
* ```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",
* location=example.location,
* resource_group_name=example.name,
* sku="PerGB2018",
* retention_in_days=30)
* example_workspace_table = azure.loganalytics.WorkspaceTable("example",
* workspace_id=example_analytics_workspace.id,
* name="AppMetrics",
* retention_in_days=60,
* total_retention_in_days=180)
* ```
* ```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",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Sku = "PerGB2018",
* RetentionInDays = 30,
* });
* var exampleWorkspaceTable = new Azure.LogAnalytics.WorkspaceTable("example", new()
* {
* WorkspaceId = exampleAnalyticsWorkspace.Id,
* Name = "AppMetrics",
* RetentionInDays = 60,
* TotalRetentionInDays = 180,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights"
* "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"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Sku: pulumi.String("PerGB2018"),
* RetentionInDays: pulumi.Int(30),
* })
* if err != nil {
* return err
* }
* _, err = loganalytics.NewWorkspaceTable(ctx, "example", &loganalytics.WorkspaceTableArgs{
* WorkspaceId: exampleAnalyticsWorkspace.ID(),
* Name: pulumi.String("AppMetrics"),
* RetentionInDays: pulumi.Int(60),
* TotalRetentionInDays: pulumi.Int(180),
* })
* 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.loganalytics.WorkspaceTable;
* import com.pulumi.azure.loganalytics.WorkspaceTableArgs;
* 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")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku("PerGB2018")
* .retentionInDays(30)
* .build());
* var exampleWorkspaceTable = new WorkspaceTable("exampleWorkspaceTable", WorkspaceTableArgs.builder()
* .workspaceId(exampleAnalyticsWorkspace.id())
* .name("AppMetrics")
* .retentionInDays(60)
* .totalRetentionInDays(180)
* .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
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku: PerGB2018
* retentionInDays: 30
* exampleWorkspaceTable:
* type: azure:loganalytics:WorkspaceTable
* name: example
* properties:
* workspaceId: ${exampleAnalyticsWorkspace.id}
* name: AppMetrics
* retentionInDays: 60
* totalRetentionInDays: 180
* ```
*
* @property name Specifies the name of a table in a Log Analytics Workspace.
* @property plan Specify the system how to handle and charge the logs ingested to the table. Possible values are `Analytics` and `Basic`. Defaults to `Analytics`.
* > **Note:** The `name` of tables currently supported by the `Basic` plan can be found [here](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-configure?tabs=portal-1#supported-tables).
* @property retentionInDays The table's retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
* @property totalRetentionInDays The table's total retention in days. Possible values range between 30 and 4383.
* > **Note:** `retention_in_days` and `total_retention_in_days` will revert back to the value of azure.operationalinsights.AnalyticsWorkspace retention_in_days when a azure.loganalytics.WorkspaceTable is deleted.
* > **Note:** The `retention_in_days` cannot be specified when `plan` is `Basic` because the retention is fixed at eight days.
* @property workspaceId The object ID of the Log Analytics Workspace that contains the table.
*/
public data class WorkspaceTableArgs(
public val name: Output? = null,
public val plan: Output? = null,
public val retentionInDays: Output? = null,
public val totalRetentionInDays: Output? = null,
public val workspaceId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.loganalytics.WorkspaceTableArgs =
com.pulumi.azure.loganalytics.WorkspaceTableArgs.builder()
.name(name?.applyValue({ args0 -> args0 }))
.plan(plan?.applyValue({ args0 -> args0 }))
.retentionInDays(retentionInDays?.applyValue({ args0 -> args0 }))
.totalRetentionInDays(totalRetentionInDays?.applyValue({ args0 -> args0 }))
.workspaceId(workspaceId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [WorkspaceTableArgs].
*/
@PulumiTagMarker
public class WorkspaceTableArgsBuilder internal constructor() {
private var name: Output? = null
private var plan: Output? = null
private var retentionInDays: Output? = null
private var totalRetentionInDays: Output? = null
private var workspaceId: Output? = null
/**
* @param value Specifies the name of a table in a Log Analytics Workspace.
*/
@JvmName("btoslbkmmhwpeuuc")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value Specify the system how to handle and charge the logs ingested to the table. Possible values are `Analytics` and `Basic`. Defaults to `Analytics`.
* > **Note:** The `name` of tables currently supported by the `Basic` plan can be found [here](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-configure?tabs=portal-1#supported-tables).
*/
@JvmName("afndygiscjjoauch")
public suspend fun plan(`value`: Output) {
this.plan = value
}
/**
* @param value The table's retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
*/
@JvmName("luhylqjqmxbckgui")
public suspend fun retentionInDays(`value`: Output) {
this.retentionInDays = value
}
/**
* @param value The table's total retention in days. Possible values range between 30 and 4383.
* > **Note:** `retention_in_days` and `total_retention_in_days` will revert back to the value of azure.operationalinsights.AnalyticsWorkspace retention_in_days when a azure.loganalytics.WorkspaceTable is deleted.
* > **Note:** The `retention_in_days` cannot be specified when `plan` is `Basic` because the retention is fixed at eight days.
*/
@JvmName("lapgrcojgesvtqje")
public suspend fun totalRetentionInDays(`value`: Output) {
this.totalRetentionInDays = value
}
/**
* @param value The object ID of the Log Analytics Workspace that contains the table.
*/
@JvmName("jxshtldhowfjvsgn")
public suspend fun workspaceId(`value`: Output) {
this.workspaceId = value
}
/**
* @param value Specifies the name of a table in a Log Analytics Workspace.
*/
@JvmName("xogfclbvljrcshao")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value Specify the system how to handle and charge the logs ingested to the table. Possible values are `Analytics` and `Basic`. Defaults to `Analytics`.
* > **Note:** The `name` of tables currently supported by the `Basic` plan can be found [here](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/basic-logs-configure?tabs=portal-1#supported-tables).
*/
@JvmName("uukpvknsuiepaief")
public suspend fun plan(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.plan = mapped
}
/**
* @param value The table's retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
*/
@JvmName("hdxhykhijoeiuetq")
public suspend fun retentionInDays(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.retentionInDays = mapped
}
/**
* @param value The table's total retention in days. Possible values range between 30 and 4383.
* > **Note:** `retention_in_days` and `total_retention_in_days` will revert back to the value of azure.operationalinsights.AnalyticsWorkspace retention_in_days when a azure.loganalytics.WorkspaceTable is deleted.
* > **Note:** The `retention_in_days` cannot be specified when `plan` is `Basic` because the retention is fixed at eight days.
*/
@JvmName("ekdkpkmqtcvscjku")
public suspend fun totalRetentionInDays(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.totalRetentionInDays = mapped
}
/**
* @param value The object ID of the Log Analytics Workspace that contains the table.
*/
@JvmName("geqddfguxdvjwptu")
public suspend fun workspaceId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.workspaceId = mapped
}
internal fun build(): WorkspaceTableArgs = WorkspaceTableArgs(
name = name,
plan = plan,
retentionInDays = retentionInDays,
totalRetentionInDays = totalRetentionInDays,
workspaceId = workspaceId,
)
}