GetAnalyticsWorkspace
Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var example = Output.Create(Azure.OperationalInsights.GetAnalyticsWorkspace.InvokeAsync(new Azure.OperationalInsights.GetAnalyticsWorkspaceArgs
{
Name = "acctest-01",
ResourceGroupName = "acctest",
}));
this.LogAnalyticsWorkspaceId = example.Apply(example => example.WorkspaceId);
}
[Output("logAnalyticsWorkspaceId")]
public Output<string> LogAnalyticsWorkspaceId { get; set; }
}
package main
import (
"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 {
example, err := operationalinsights.LookupAnalyticsWorkspace(ctx, &operationalinsights.LookupAnalyticsWorkspaceArgs{
Name: "acctest-01",
ResourceGroupName: "acctest",
}, nil)
if err != nil {
return err
}
ctx.Export("logAnalyticsWorkspaceId", example.WorkspaceId)
return nil
})
}import pulumi
import pulumi_azure as azure
example = azure.operationalinsights.get_analytics_workspace(name="acctest-01",
resource_group_name="acctest")
pulumi.export("logAnalyticsWorkspaceId", example.workspace_id)import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.operationalinsights.getAnalyticsWorkspace({
name: "acctest-01",
resourceGroupName: "acctest",
});
export const logAnalyticsWorkspaceId = example.then(example => example.workspaceId);Using GetAnalyticsWorkspace
function getAnalyticsWorkspace(args: GetAnalyticsWorkspaceArgs, opts?: InvokeOptions): Promise<GetAnalyticsWorkspaceResult>function get_analytics_workspace(name=None, resource_group_name=None, opts=None)func LookupAnalyticsWorkspace(ctx *Context, args *LookupAnalyticsWorkspaceArgs, opts ...InvokeOption) (*LookupAnalyticsWorkspaceResult, error)Note: This function is named
LookupAnalyticsWorkspacein the Go SDK.
public static class GetAnalyticsWorkspace {
public static Task<GetAnalyticsWorkspaceResult> InvokeAsync(GetAnalyticsWorkspaceArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Name string
Specifies the name of the Log Analytics Workspace.
- Resource
Group stringName The name of the resource group in which the Log Analytics workspace is located in.
- Name string
Specifies the name of the Log Analytics Workspace.
- Resource
Group stringName The name of the resource group in which the Log Analytics workspace is located in.
- name string
Specifies the name of the Log Analytics Workspace.
- resource
Group stringName The name of the resource group in which the Log Analytics workspace is located in.
- name str
Specifies the name of the Log Analytics Workspace.
- resource_
group_ strname The name of the resource group in which the Log Analytics workspace is located in.
GetAnalyticsWorkspace Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Location string
- Name string
- Portal
Url string The Portal URL for the Log Analytics Workspace.
- string
The Primary shared key for the Log Analytics Workspace.
- Resource
Group stringName - Retention
In intDays The workspace data retention in days.
- string
The Secondary shared key for the Log Analytics Workspace.
- Sku string
The Sku of the Log Analytics Workspace.
- Dictionary<string, string>
A mapping of tags assigned to the resource.
- Workspace
Id string The Workspace (or Customer) ID for the Log Analytics Workspace.
- Id string
The provider-assigned unique ID for this managed resource.
- Location string
- Name string
- Portal
Url string The Portal URL for the Log Analytics Workspace.
- string
The Primary shared key for the Log Analytics Workspace.
- Resource
Group stringName - Retention
In intDays The workspace data retention in days.
- string
The Secondary shared key for the Log Analytics Workspace.
- Sku string
The Sku of the Log Analytics Workspace.
- map[string]string
A mapping of tags assigned to the resource.
- Workspace
Id string The Workspace (or Customer) ID for the Log Analytics Workspace.
- id string
The provider-assigned unique ID for this managed resource.
- location string
- name string
- portal
Url string The Portal URL for the Log Analytics Workspace.
- string
The Primary shared key for the Log Analytics Workspace.
- resource
Group stringName - retention
In numberDays The workspace data retention in days.
- string
The Secondary shared key for the Log Analytics Workspace.
- sku string
The Sku of the Log Analytics Workspace.
- {[key: string]: string}
A mapping of tags assigned to the resource.
- workspace
Id string The Workspace (or Customer) ID for the Log Analytics Workspace.
- id str
The provider-assigned unique ID for this managed resource.
- location str
- name str
- portal_
url str The Portal URL for the Log Analytics Workspace.
- str
The Primary shared key for the Log Analytics Workspace.
- resource_
group_ strname - retention_
in_ floatdays The workspace data retention in days.
- str
The Secondary shared key for the Log Analytics Workspace.
- sku str
The Sku of the Log Analytics Workspace.
- Dict[str, str]
A mapping of tags assigned 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.