We recommend using Azure Native.
azure.monitoring.getDiagnosticCategories
Explore with Pulumi AI
Use this data source to access information about the Monitor Diagnostics Categories supported by an existing Resource.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleKeyVault = Azure.KeyVault.GetKeyVault.Invoke(new()
{
Name = azurerm_key_vault.Example.Name,
ResourceGroupName = azurerm_key_vault.Example.Resource_group_name,
});
var exampleDiagnosticCategories = Azure.Monitoring.GetDiagnosticCategories.Invoke(new()
{
ResourceId = exampleKeyVault.Apply(getKeyVaultResult => getKeyVaultResult.Id),
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/keyvault"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleKeyVault, err := keyvault.LookupKeyVault(ctx, &keyvault.LookupKeyVaultArgs{
Name: azurerm_key_vault.Example.Name,
ResourceGroupName: azurerm_key_vault.Example.Resource_group_name,
}, nil)
if err != nil {
return err
}
_, err = monitoring.GetDiagnosticCategories(ctx, &monitoring.GetDiagnosticCategoriesArgs{
ResourceId: exampleKeyVault.Id,
}, nil)
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.keyvault.KeyvaultFunctions;
import com.pulumi.azure.keyvault.inputs.GetKeyVaultArgs;
import com.pulumi.azure.monitoring.MonitoringFunctions;
import com.pulumi.azure.monitoring.inputs.GetDiagnosticCategoriesArgs;
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 exampleKeyVault = KeyvaultFunctions.getKeyVault(GetKeyVaultArgs.builder()
.name(azurerm_key_vault.example().name())
.resourceGroupName(azurerm_key_vault.example().resource_group_name())
.build());
final var exampleDiagnosticCategories = MonitoringFunctions.getDiagnosticCategories(GetDiagnosticCategoriesArgs.builder()
.resourceId(exampleKeyVault.applyValue(getKeyVaultResult -> getKeyVaultResult.id()))
.build());
}
}
import pulumi
import pulumi_azure as azure
example_key_vault = azure.keyvault.get_key_vault(name=azurerm_key_vault["example"]["name"],
resource_group_name=azurerm_key_vault["example"]["resource_group_name"])
example_diagnostic_categories = azure.monitoring.get_diagnostic_categories(resource_id=example_key_vault.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleKeyVault = azure.keyvault.getKeyVault({
name: azurerm_key_vault.example.name,
resourceGroupName: azurerm_key_vault.example.resource_group_name,
});
const exampleDiagnosticCategories = exampleKeyVault.then(exampleKeyVault => azure.monitoring.getDiagnosticCategories({
resourceId: exampleKeyVault.id,
}));
variables:
exampleKeyVault:
fn::invoke:
Function: azure:keyvault:getKeyVault
Arguments:
name: ${azurerm_key_vault.example.name}
resourceGroupName: ${azurerm_key_vault.example.resource_group_name}
exampleDiagnosticCategories:
fn::invoke:
Function: azure:monitoring:getDiagnosticCategories
Arguments:
resourceId: ${exampleKeyVault.id}
Using getDiagnosticCategories
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 getDiagnosticCategories(args: GetDiagnosticCategoriesArgs, opts?: InvokeOptions): Promise<GetDiagnosticCategoriesResult>
function getDiagnosticCategoriesOutput(args: GetDiagnosticCategoriesOutputArgs, opts?: InvokeOptions): Output<GetDiagnosticCategoriesResult>
def get_diagnostic_categories(resource_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDiagnosticCategoriesResult
def get_diagnostic_categories_output(resource_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDiagnosticCategoriesResult]
func GetDiagnosticCategories(ctx *Context, args *GetDiagnosticCategoriesArgs, opts ...InvokeOption) (*GetDiagnosticCategoriesResult, error)
func GetDiagnosticCategoriesOutput(ctx *Context, args *GetDiagnosticCategoriesOutputArgs, opts ...InvokeOption) GetDiagnosticCategoriesResultOutput
> Note: This function is named GetDiagnosticCategories
in the Go SDK.
public static class GetDiagnosticCategories
{
public static Task<GetDiagnosticCategoriesResult> InvokeAsync(GetDiagnosticCategoriesArgs args, InvokeOptions? opts = null)
public static Output<GetDiagnosticCategoriesResult> Invoke(GetDiagnosticCategoriesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDiagnosticCategoriesResult> getDiagnosticCategories(GetDiagnosticCategoriesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azure:monitoring/getDiagnosticCategories:getDiagnosticCategories
arguments:
# arguments dictionary
The following arguments are supported:
- Resource
Id string The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
- Resource
Id string The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
- resource
Id String The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
- resource
Id string The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
- resource_
id str The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
- resource
Id String The ID of an existing Resource which Monitor Diagnostics Categories should be retrieved for.
getDiagnosticCategories Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Log
Category List<string>Groups A list of the supported log category groups of this resource to send to the destination.
- Log
Category List<string>Types A list of the supported log category types of this resource to send to the destination.
- Logs List<string>
A list of the Log Categories supported for this Resource.
logs
will be removed in favour of the propertylog_category_types
in version 4.0 of the AzureRM Provider.- Metrics List<string>
A list of the Metric Categories supported for this Resource.
- Resource
Id string
- Id string
The provider-assigned unique ID for this managed resource.
- Log
Category []stringGroups A list of the supported log category groups of this resource to send to the destination.
- Log
Category []stringTypes A list of the supported log category types of this resource to send to the destination.
- Logs []string
A list of the Log Categories supported for this Resource.
logs
will be removed in favour of the propertylog_category_types
in version 4.0 of the AzureRM Provider.- Metrics []string
A list of the Metric Categories supported for this Resource.
- Resource
Id string
- id String
The provider-assigned unique ID for this managed resource.
- log
Category List<String>Groups A list of the supported log category groups of this resource to send to the destination.
- log
Category List<String>Types A list of the supported log category types of this resource to send to the destination.
- logs List<String>
A list of the Log Categories supported for this Resource.
logs
will be removed in favour of the propertylog_category_types
in version 4.0 of the AzureRM Provider.- metrics List<String>
A list of the Metric Categories supported for this Resource.
- resource
Id String
- id string
The provider-assigned unique ID for this managed resource.
- log
Category string[]Groups A list of the supported log category groups of this resource to send to the destination.
- log
Category string[]Types A list of the supported log category types of this resource to send to the destination.
- logs string[]
A list of the Log Categories supported for this Resource.
logs
will be removed in favour of the propertylog_category_types
in version 4.0 of the AzureRM Provider.- metrics string[]
A list of the Metric Categories supported for this Resource.
- resource
Id string
- id str
The provider-assigned unique ID for this managed resource.
- log_
category_ Sequence[str]groups A list of the supported log category groups of this resource to send to the destination.
- log_
category_ Sequence[str]types A list of the supported log category types of this resource to send to the destination.
- logs Sequence[str]
A list of the Log Categories supported for this Resource.
logs
will be removed in favour of the propertylog_category_types
in version 4.0 of the AzureRM Provider.- metrics Sequence[str]
A list of the Metric Categories supported for this Resource.
- resource_
id str
- id String
The provider-assigned unique ID for this managed resource.
- log
Category List<String>Groups A list of the supported log category groups of this resource to send to the destination.
- log
Category List<String>Types A list of the supported log category types of this resource to send to the destination.
- logs List<String>
A list of the Log Categories supported for this Resource.
logs
will be removed in favour of the propertylog_category_types
in version 4.0 of the AzureRM Provider.- metrics List<String>
A list of the Metric Categories supported for this Resource.
- resource
Id String
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.