Analytics Workspace
Manages a Log Analytics (formally Operational Insights) Workspace.
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,
});
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)
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,
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"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
}
_, 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
}
return nil
})
}
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 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());
}
}
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
Import
Log Analytics Workspaces can be imported using the resource id
, e.g.
$ pulumi import azure:operationalinsights/analyticsWorkspace:AnalyticsWorkspace workspace1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1
Properties
Specifies if the log Analytics Workspace allow users accessing to data associated with resources they have permission to view, without permission to workspace. Defaults to true
.
Is Customer Managed Storage mandatory for query management?
The workspace daily quota for ingestion in GB. Defaults to -1
(unlimited) if omitted.
The ID of the Data Collection Rule to use for this workspace.
An identity
block as defined below.
Whether to remove the data in the Log Analytics Workspace immediately after 30 days.
Should the Log Analytics Workspace support ingestion over the Public Internet? Defaults to true
.
Should the Log Analytics Workspace support querying over the Public Internet? Defaults to true
.
Specifies if the log Analytics workspace should enforce authentication using Azure AD. Defaults to false
.
The Primary shared key for the Log Analytics Workspace.
The capacity reservation level in GB for this workspace. Possible values are 100
, 200
, 300
, 400
, 500
, 1000
, 2000
and 5000
.
The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
The workspace data retention in days. Possible values are between 30
and 730
.
The Secondary shared key for the Log Analytics Workspace.
The Workspace (or Customer) ID for the Log Analytics Workspace.