AnalyticsWorkspace
Manages a Log Analytics (formally Operational Insights) Workspace.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "East US",
});
var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new Azure.OperationalInsights.AnalyticsWorkspaceArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
Sku = "PerGB2018",
RetentionInDays = 30,
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/operationalinsights"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("East US"),
})
if err != nil {
return err
}
_, err = operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
Sku: pulumi.String("PerGB2018"),
RetentionInDays: pulumi.Int(30),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="East US")
example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku="PerGB2018",
retention_in_days=30)import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "East US"});
const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
sku: "PerGB2018",
retentionInDays: 30,
});Create a AnalyticsWorkspace Resource
new AnalyticsWorkspace(name: string, args: AnalyticsWorkspaceArgs, opts?: CustomResourceOptions);def AnalyticsWorkspace(resource_name, opts=None, location=None, name=None, resource_group_name=None, retention_in_days=None, sku=None, tags=None, __props__=None);func NewAnalyticsWorkspace(ctx *Context, name string, args AnalyticsWorkspaceArgs, opts ...ResourceOption) (*AnalyticsWorkspace, error)public AnalyticsWorkspace(string name, AnalyticsWorkspaceArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args AnalyticsWorkspaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AnalyticsWorkspaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AnalyticsWorkspaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
AnalyticsWorkspace Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The AnalyticsWorkspace resource accepts the following input properties:
- Resource
Group stringName The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
- Sku string
Specifies the Sku of the Log Analytics Workspace. Possible values are
Free,PerNode,Premium,Standard,Standalone,Unlimited, andPerGB2018(new Sku as of2018-04-03).- Location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or ‘-’. The ‘-’ shouldn’t be the first or the last symbol. Changing this forces a new resource to be created.
- Retention
In intDays The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Resource
Group stringName The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
- Sku string
Specifies the Sku of the Log Analytics Workspace. Possible values are
Free,PerNode,Premium,Standard,Standalone,Unlimited, andPerGB2018(new Sku as of2018-04-03).- Location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or ‘-’. The ‘-’ shouldn’t be the first or the last symbol. Changing this forces a new resource to be created.
- Retention
In intDays The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
- map[string]string
A mapping of tags to assign to the resource.
- resource
Group stringName The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
- sku string
Specifies the Sku of the Log Analytics Workspace. Possible values are
Free,PerNode,Premium,Standard,Standalone,Unlimited, andPerGB2018(new Sku as of2018-04-03).- location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name string
Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or ‘-’. The ‘-’ shouldn’t be the first or the last symbol. Changing this forces a new resource to be created.
- retention
In numberDays The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
- {[key: string]: string}
A mapping of tags to assign to the resource.
- resource_
group_ strname The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
- sku str
Specifies the Sku of the Log Analytics Workspace. Possible values are
Free,PerNode,Premium,Standard,Standalone,Unlimited, andPerGB2018(new Sku as of2018-04-03).- location str
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name str
Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or ‘-’. The ‘-’ shouldn’t be the first or the last symbol. Changing this forces a new resource to be created.
- retention_
in_ floatdays The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
- Dict[str, str]
A mapping of tags to assign to the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the AnalyticsWorkspace resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Portal
Url string The Portal URL for the Log Analytics Workspace.
- string
The Primary shared key for the Log Analytics Workspace.
- string
The Secondary shared key for the Log Analytics Workspace.
- Workspace
Id string The Workspace (or Customer) ID for the Log Analytics Workspace.
- Id string
- The provider-assigned unique ID for this managed resource.
- Portal
Url string The Portal URL for the Log Analytics Workspace.
- string
The Primary shared key for the Log Analytics Workspace.
- string
The Secondary shared key for the Log Analytics Workspace.
- Workspace
Id string The Workspace (or Customer) ID for the Log Analytics Workspace.
- id string
- The provider-assigned unique ID for this managed resource.
- portal
Url string The Portal URL for the Log Analytics Workspace.
- string
The Primary shared key for the Log Analytics Workspace.
- string
The Secondary shared key for the Log Analytics Workspace.
- workspace
Id string The Workspace (or Customer) ID for the Log Analytics Workspace.
- id str
- The provider-assigned unique ID for this managed resource.
- portal_
url str The Portal URL for the Log Analytics Workspace.
- str
The Primary shared key for the Log Analytics Workspace.
- str
The Secondary shared key for the Log Analytics Workspace.
- workspace_
id str The Workspace (or Customer) ID for the Log Analytics Workspace.
Look up an Existing AnalyticsWorkspace Resource
Get an existing AnalyticsWorkspace 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?: AnalyticsWorkspaceState, opts?: CustomResourceOptions): AnalyticsWorkspacestatic get(resource_name, id, opts=None, location=None, name=None, portal_url=None, primary_shared_key=None, resource_group_name=None, retention_in_days=None, secondary_shared_key=None, sku=None, tags=None, workspace_id=None, __props__=None);func GetAnalyticsWorkspace(ctx *Context, name string, id IDInput, state *AnalyticsWorkspaceState, opts ...ResourceOption) (*AnalyticsWorkspace, error)public static AnalyticsWorkspace Get(string name, Input<string> id, AnalyticsWorkspaceState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or ‘-’. The ‘-’ shouldn’t be the first or the last symbol. Changing this forces a new resource to be created.
- Portal
Url string The Portal URL for the Log Analytics Workspace.
- string
The Primary shared key for the Log Analytics Workspace.
- Resource
Group stringName The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
- Retention
In intDays The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
- string
The Secondary shared key for the Log Analytics Workspace.
- Sku string
Specifies the Sku of the Log Analytics Workspace. Possible values are
Free,PerNode,Premium,Standard,Standalone,Unlimited, andPerGB2018(new Sku as of2018-04-03).- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Workspace
Id string The Workspace (or Customer) ID for the Log Analytics Workspace.
- Location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- Name string
Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or ‘-’. The ‘-’ shouldn’t be the first or the last symbol. Changing this forces a new resource to be created.
- Portal
Url string The Portal URL for the Log Analytics Workspace.
- string
The Primary shared key for the Log Analytics Workspace.
- Resource
Group stringName The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
- Retention
In intDays The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
- string
The Secondary shared key for the Log Analytics Workspace.
- Sku string
Specifies the Sku of the Log Analytics Workspace. Possible values are
Free,PerNode,Premium,Standard,Standalone,Unlimited, andPerGB2018(new Sku as of2018-04-03).- map[string]string
A mapping of tags to assign to the resource.
- Workspace
Id string The Workspace (or Customer) ID for the Log Analytics Workspace.
- location string
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name string
Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or ‘-’. The ‘-’ shouldn’t be the first or the last symbol. Changing this forces a new resource to be created.
- portal
Url string The Portal URL for the Log Analytics Workspace.
- string
The Primary shared key for the Log Analytics Workspace.
- resource
Group stringName The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
- retention
In numberDays The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
- string
The Secondary shared key for the Log Analytics Workspace.
- sku string
Specifies the Sku of the Log Analytics Workspace. Possible values are
Free,PerNode,Premium,Standard,Standalone,Unlimited, andPerGB2018(new Sku as of2018-04-03).- {[key: string]: string}
A mapping of tags to assign to the resource.
- workspace
Id string The Workspace (or Customer) ID for the Log Analytics Workspace.
- location str
Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
- name str
Specifies the name of the Log Analytics Workspace. Workspace name should include 4-63 letters, digits or ‘-’. The ‘-’ shouldn’t be the first or the last symbol. Changing this forces a new resource to be created.
- portal_
url str The Portal URL for the Log Analytics Workspace.
- str
The Primary shared key for the Log Analytics Workspace.
- resource_
group_ strname The name of the resource group in which the Log Analytics workspace is created. Changing this forces a new resource to be created.
- retention_
in_ floatdays The workspace data retention in days. Possible values are either 7 (Free Tier only) or range between 30 and 730.
- str
The Secondary shared key for the Log Analytics Workspace.
- sku str
Specifies the Sku of the Log Analytics Workspace. Possible values are
Free,PerNode,Premium,Standard,Standalone,Unlimited, andPerGB2018(new Sku as of2018-04-03).- Dict[str, str]
A mapping of tags to assign to the resource.
- workspace_
id str The Workspace (or Customer) ID for the Log Analytics Workspace.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.