We recommend using Azure Native.
Azure Classic v5.81.0 published on Monday, Jun 24, 2024 by Pulumi
azure.operationalinsights.getAnalyticsWorkspace
Explore with Pulumi AI
Use this data source to access information about an existing Log Analytics (formally Operational Insights) Workspace.
Example Usage
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);
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)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.OperationalInsights.GetAnalyticsWorkspace.Invoke(new()
{
Name = "acctest-01",
ResourceGroupName = "acctest",
});
return new Dictionary<string, object?>
{
["logAnalyticsWorkspaceId"] = example.Apply(getAnalyticsWorkspaceResult => getAnalyticsWorkspaceResult.WorkspaceId),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.operationalinsights.OperationalinsightsFunctions;
import com.pulumi.azure.operationalinsights.inputs.GetAnalyticsWorkspaceArgs;
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) {
final var example = OperationalinsightsFunctions.getAnalyticsWorkspace(GetAnalyticsWorkspaceArgs.builder()
.name("acctest-01")
.resourceGroupName("acctest")
.build());
ctx.export("logAnalyticsWorkspaceId", example.applyValue(getAnalyticsWorkspaceResult -> getAnalyticsWorkspaceResult.workspaceId()));
}
}
variables:
example:
fn::invoke:
Function: azure:operationalinsights:getAnalyticsWorkspace
Arguments:
name: acctest-01
resourceGroupName: acctest
outputs:
logAnalyticsWorkspaceId: ${example.workspaceId}
Using getAnalyticsWorkspace
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getAnalyticsWorkspace(args: GetAnalyticsWorkspaceArgs, opts?: InvokeOptions): Promise<GetAnalyticsWorkspaceResult>
function getAnalyticsWorkspaceOutput(args: GetAnalyticsWorkspaceOutputArgs, opts?: InvokeOptions): Output<GetAnalyticsWorkspaceResult>
def get_analytics_workspace(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAnalyticsWorkspaceResult
def get_analytics_workspace_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAnalyticsWorkspaceResult]
func LookupAnalyticsWorkspace(ctx *Context, args *LookupAnalyticsWorkspaceArgs, opts ...InvokeOption) (*LookupAnalyticsWorkspaceResult, error)
func LookupAnalyticsWorkspaceOutput(ctx *Context, args *LookupAnalyticsWorkspaceOutputArgs, opts ...InvokeOption) LookupAnalyticsWorkspaceResultOutput
> Note: This function is named LookupAnalyticsWorkspace
in the Go SDK.
public static class GetAnalyticsWorkspace
{
public static Task<GetAnalyticsWorkspaceResult> InvokeAsync(GetAnalyticsWorkspaceArgs args, InvokeOptions? opts = null)
public static Output<GetAnalyticsWorkspaceResult> Invoke(GetAnalyticsWorkspaceInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAnalyticsWorkspaceResult> getAnalyticsWorkspace(GetAnalyticsWorkspaceArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azure:operationalinsights/getAnalyticsWorkspace:getAnalyticsWorkspace
arguments:
# arguments dictionary
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 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.
- 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.
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
- 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
- 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 DoubleGb - The workspace daily quota for ingestion in GB.
- id String
- The provider-assigned unique ID for this managed resource.
- location String
- name String
- String
- The Primary shared key for the Log Analytics Workspace.
- resource
Group StringName - retention
In IntegerDays - 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
- 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
- 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.
- 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
- 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.
- Map<String>
- A mapping of tags assigned to the resource.
- workspace
Id String - The Workspace (or Customer) ID for the Log Analytics Workspace.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.