com.pulumi.azure.loganalytics.kotlin.WorkspaceTable.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.loganalytics.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [WorkspaceTable].
*/
@PulumiTagMarker
public class WorkspaceTableResourceBuilder internal constructor() {
public var name: String? = null
public var args: WorkspaceTableArgs = WorkspaceTableArgs()
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 WorkspaceTableArgsBuilder.() -> Unit) {
val builder = WorkspaceTableArgsBuilder()
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(): WorkspaceTable {
val builtJavaResource = com.pulumi.azure.loganalytics.WorkspaceTable(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return WorkspaceTable(builtJavaResource)
}
}
/**
* 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
* ```
*
*/
public class WorkspaceTable internal constructor(
override val javaResource: com.pulumi.azure.loganalytics.WorkspaceTable,
) : KotlinCustomResource(javaResource, WorkspaceTableMapper) {
/**
* Specifies the name of a table in a Log Analytics Workspace.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* 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).
*/
public val plan: Output?
get() = javaResource.plan().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The table's retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
*/
public val retentionInDays: Output?
get() = javaResource.retentionInDays().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* 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.
*/
public val totalRetentionInDays: Output?
get() = javaResource.totalRetentionInDays().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The object ID of the Log Analytics Workspace that contains the table.
*/
public val workspaceId: Output
get() = javaResource.workspaceId().applyValue({ args0 -> args0 })
}
public object WorkspaceTableMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.loganalytics.WorkspaceTable::class == javaResource::class
override fun map(javaResource: Resource): WorkspaceTable = WorkspaceTable(
javaResource as
com.pulumi.azure.loganalytics.WorkspaceTable,
)
}
/**
* @see [WorkspaceTable].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [WorkspaceTable].
*/
public suspend fun workspaceTable(
name: String,
block: suspend WorkspaceTableResourceBuilder.() -> Unit,
): WorkspaceTable {
val builder = WorkspaceTableResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [WorkspaceTable].
* @param name The _unique_ name of the resulting resource.
*/
public fun workspaceTable(name: String): WorkspaceTable {
val builder = WorkspaceTableResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy