We recommend using Azure Native.
azure.loganalytics.WorkspaceTable
Explore with Pulumi AI
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
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,
});
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)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/loganalytics"
"github.com/pulumi/pulumi-azure/sdk/v6/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
})
}
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,
});
});
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());
}
}
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
Create WorkspaceTable Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new WorkspaceTable(name: string, args: WorkspaceTableArgs, opts?: CustomResourceOptions);
@overload
def WorkspaceTable(resource_name: str,
args: WorkspaceTableArgs,
opts: Optional[ResourceOptions] = None)
@overload
def WorkspaceTable(resource_name: str,
opts: Optional[ResourceOptions] = None,
workspace_id: Optional[str] = None,
name: Optional[str] = None,
plan: Optional[str] = None,
retention_in_days: Optional[int] = None,
total_retention_in_days: Optional[int] = None)
func NewWorkspaceTable(ctx *Context, name string, args WorkspaceTableArgs, opts ...ResourceOption) (*WorkspaceTable, error)
public WorkspaceTable(string name, WorkspaceTableArgs args, CustomResourceOptions? opts = null)
public WorkspaceTable(String name, WorkspaceTableArgs args)
public WorkspaceTable(String name, WorkspaceTableArgs args, CustomResourceOptions options)
type: azure:loganalytics:WorkspaceTable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args WorkspaceTableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args WorkspaceTableArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WorkspaceTableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkspaceTableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkspaceTableArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var workspaceTableResource = new Azure.LogAnalytics.WorkspaceTable("workspaceTableResource", new()
{
WorkspaceId = "string",
Name = "string",
Plan = "string",
RetentionInDays = 0,
TotalRetentionInDays = 0,
});
example, err := loganalytics.NewWorkspaceTable(ctx, "workspaceTableResource", &loganalytics.WorkspaceTableArgs{
WorkspaceId: pulumi.String("string"),
Name: pulumi.String("string"),
Plan: pulumi.String("string"),
RetentionInDays: pulumi.Int(0),
TotalRetentionInDays: pulumi.Int(0),
})
var workspaceTableResource = new WorkspaceTable("workspaceTableResource", WorkspaceTableArgs.builder()
.workspaceId("string")
.name("string")
.plan("string")
.retentionInDays(0)
.totalRetentionInDays(0)
.build());
workspace_table_resource = azure.loganalytics.WorkspaceTable("workspaceTableResource",
workspace_id="string",
name="string",
plan="string",
retention_in_days=0,
total_retention_in_days=0)
const workspaceTableResource = new azure.loganalytics.WorkspaceTable("workspaceTableResource", {
workspaceId: "string",
name: "string",
plan: "string",
retentionInDays: 0,
totalRetentionInDays: 0,
});
type: azure:loganalytics:WorkspaceTable
properties:
name: string
plan: string
retentionInDays: 0
totalRetentionInDays: 0
workspaceId: string
WorkspaceTable Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The WorkspaceTable resource accepts the following input properties:
- Workspace
Id string - The object ID of the Log Analytics Workspace that contains the table.
- Name string
- Specifies the name of a table in a Log Analytics Workspace.
- Plan string
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- Retention
In intDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - Total
Retention intIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.
- Workspace
Id string - The object ID of the Log Analytics Workspace that contains the table.
- Name string
- Specifies the name of a table in a Log Analytics Workspace.
- Plan string
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- Retention
In intDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - Total
Retention intIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.
- workspace
Id String - The object ID of the Log Analytics Workspace that contains the table.
- name String
- Specifies the name of a table in a Log Analytics Workspace.
- plan String
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- retention
In IntegerDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - total
Retention IntegerIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.
- workspace
Id string - The object ID of the Log Analytics Workspace that contains the table.
- name string
- Specifies the name of a table in a Log Analytics Workspace.
- plan string
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- retention
In numberDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - total
Retention numberIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.
- workspace_
id str - The object ID of the Log Analytics Workspace that contains the table.
- name str
- Specifies the name of a table in a Log Analytics Workspace.
- plan str
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- retention_
in_ intdays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - total_
retention_ intin_ days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.
- workspace
Id String - The object ID of the Log Analytics Workspace that contains the table.
- name String
- Specifies the name of a table in a Log Analytics Workspace.
- plan String
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- retention
In NumberDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - total
Retention NumberIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.
Outputs
All input properties are implicitly available as output properties. Additionally, the WorkspaceTable resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing WorkspaceTable Resource
Get an existing WorkspaceTable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: WorkspaceTableState, opts?: CustomResourceOptions): WorkspaceTable
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
plan: Optional[str] = None,
retention_in_days: Optional[int] = None,
total_retention_in_days: Optional[int] = None,
workspace_id: Optional[str] = None) -> WorkspaceTable
func GetWorkspaceTable(ctx *Context, name string, id IDInput, state *WorkspaceTableState, opts ...ResourceOption) (*WorkspaceTable, error)
public static WorkspaceTable Get(string name, Input<string> id, WorkspaceTableState? state, CustomResourceOptions? opts = null)
public static WorkspaceTable get(String name, Output<String> id, WorkspaceTableState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Name string
- Specifies the name of a table in a Log Analytics Workspace.
- Plan string
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- Retention
In intDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - Total
Retention intIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.- Workspace
Id string - The object ID of the Log Analytics Workspace that contains the table.
- Name string
- Specifies the name of a table in a Log Analytics Workspace.
- Plan string
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- Retention
In intDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - Total
Retention intIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.- Workspace
Id string - The object ID of the Log Analytics Workspace that contains the table.
- name String
- Specifies the name of a table in a Log Analytics Workspace.
- plan String
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- retention
In IntegerDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - total
Retention IntegerIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.- workspace
Id String - The object ID of the Log Analytics Workspace that contains the table.
- name string
- Specifies the name of a table in a Log Analytics Workspace.
- plan string
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- retention
In numberDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - total
Retention numberIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.- workspace
Id string - The object ID of the Log Analytics Workspace that contains the table.
- name str
- Specifies the name of a table in a Log Analytics Workspace.
- plan str
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- retention_
in_ intdays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - total_
retention_ intin_ days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.- workspace_
id str - The object ID of the Log Analytics Workspace that contains the table.
- name String
- Specifies the name of a table in a Log Analytics Workspace.
- plan String
Specify the system how to handle and charge the logs ingested to the table. Possible values are
Analytics
andBasic
. Defaults toAnalytics
.Note: The
name
of tables currently supported by theBasic
plan can be found here.- retention
In NumberDays - The table's retention in days. Possible values are either
8
(Basic Tier only) or range between4
and730
. - total
Retention NumberIn Days The table's total retention in days. Possible values range between
4
and730
; or1095
,1460
,1826
,2191
,2556
,2922
,3288
,3653
,4018
, or4383
.Note:
retention_in_days
andtotal_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 whenplan
isBasic
because the retention is fixed at eight days.- workspace
Id String - The object ID of the Log Analytics Workspace that contains the table.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.