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/v4/go/azure/operationalinsights"
"github.com/pulumi/pulumi/sdk/v3/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>
def get_analytics_workspace(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAnalyticsWorkspaceResult
func LookupAnalyticsWorkspace(ctx *Context, args *LookupAnalyticsWorkspaceArgs, opts ...InvokeOption) (*LookupAnalyticsWorkspaceResult, error)
Note: This function is named
LookupAnalyticsWorkspace
in 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:
- Daily
Quota doubleGb - The workspace daily quota for ingestion in GB.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Name string
- Portal
Url string - 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.
- Daily
Quota float64Gb - The workspace daily quota for ingestion in GB.
- Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- Name string
- Portal
Url string - 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.
- daily
Quota numberGb - The workspace daily quota for ingestion in GB.
- id string
- The provider-assigned unique ID for this managed resource.
- location string
- name string
- portal
Url string - 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.
- daily_
quota_ floatgb - The workspace daily quota for ingestion in GB.
- id str
- The provider-assigned unique ID for this managed resource.
- location str
- name str
- portal_
url str - str
- The Primary shared key for the Log Analytics Workspace.
- resource_
group_ strname - retention_
in_ intdays - 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.
- Mapping[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
azurerm
Terraform Provider.