import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages an API Management Service Diagnostic. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "example-resources", * location: "West Europe", * }); * const exampleInsights = new azure.appinsights.Insights("example", { * name: "example-appinsights", * location: example.location, * resourceGroupName: example.name, * applicationType: "web", * }); * const exampleService = new azure.apimanagement.Service("example", { * name: "example-apim", * location: example.location, * resourceGroupName: example.name, * publisherName: "My Company", * publisherEmail: "company@mycompany.io", * skuName: "Developer_1", * }); * const exampleLogger = new azure.apimanagement.Logger("example", { * name: "example-apimlogger", * apiManagementName: exampleService.name, * resourceGroupName: example.name, * applicationInsights: { * instrumentationKey: exampleInsights.instrumentationKey, * }, * }); * const exampleDiagnostic = new azure.apimanagement.Diagnostic("example", { * identifier: "applicationinsights", * resourceGroupName: example.name, * apiManagementName: exampleService.name, * apiManagementLoggerId: exampleLogger.id, * samplingPercentage: 5, * alwaysLogErrors: true, * logClientIp: true, * verbosity: "verbose", * httpCorrelationProtocol: "W3C", * frontendRequest: { * bodyBytes: 32, * headersToLogs: [ * "content-type", * "accept", * "origin", * ], * }, * frontendResponse: { * bodyBytes: 32, * headersToLogs: [ * "content-type", * "content-length", * "origin", * ], * }, * backendRequest: { * bodyBytes: 32, * headersToLogs: [ * "content-type", * "accept", * "origin", * ], * }, * backendResponse: { * bodyBytes: 32, * headersToLogs: [ * "content-type", * "content-length", * "origin", * ], * }, * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.ApiManagement` - 2022-08-01 * * ## Import * * API Management Diagnostics can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:apimanagement/diagnostic:Diagnostic example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/diagnostics/applicationinsights * ``` */ export declare class Diagnostic extends pulumi.CustomResource { /** * Get an existing Diagnostic resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: DiagnosticState, opts?: pulumi.CustomResourceOptions): Diagnostic; /** * Returns true if the given object is an instance of Diagnostic. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Diagnostic; /** * Always log errors. Send telemetry if there is an erroneous condition, regardless of sampling settings. */ readonly alwaysLogErrors: pulumi.Output; /** * The id of the target API Management Logger where the API Management Diagnostic should be saved. */ readonly apiManagementLoggerId: pulumi.Output; /** * The Name of the API Management Service where this Diagnostic should be created. Changing this forces a new resource to be created. */ readonly apiManagementName: pulumi.Output; /** * A `backendRequest` block as defined below. */ readonly backendRequest: pulumi.Output; /** * A `backendResponse` block as defined below. */ readonly backendResponse: pulumi.Output; /** * A `frontendRequest` block as defined below. */ readonly frontendRequest: pulumi.Output; /** * A `frontendResponse` block as defined below. */ readonly frontendResponse: pulumi.Output; /** * The HTTP Correlation Protocol to use. Possible values are `None`, `Legacy` or `W3C`. */ readonly httpCorrelationProtocol: pulumi.Output; /** * The diagnostic identifier for the API Management Service. At this time the supported values are `applicationinsights` and `azuremonitor`. Changing this forces a new resource to be created. */ readonly identifier: pulumi.Output; /** * Log client IP address. */ readonly logClientIp: pulumi.Output; /** * The format of the Operation Name for Application Insights telemetries. Possible values are `Name`, and `Url`. */ readonly operationNameFormat: pulumi.Output; /** * The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; /** * Sampling (%). For high traffic APIs, please read this [documentation](https://docs.microsoft.com/azure/api-management/api-management-howto-app-insights#performance-implications-and-log-sampling) to understand performance implications and log sampling. Valid values are between `0.0` and `100.0`. */ readonly samplingPercentage: pulumi.Output; /** * Logging verbosity. Possible values are `verbose`, `information` or `error`. */ readonly verbosity: pulumi.Output; /** * Create a Diagnostic resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DiagnosticArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Diagnostic resources. */ export interface DiagnosticState { /** * Always log errors. Send telemetry if there is an erroneous condition, regardless of sampling settings. */ alwaysLogErrors?: pulumi.Input; /** * The id of the target API Management Logger where the API Management Diagnostic should be saved. */ apiManagementLoggerId?: pulumi.Input; /** * The Name of the API Management Service where this Diagnostic should be created. Changing this forces a new resource to be created. */ apiManagementName?: pulumi.Input; /** * A `backendRequest` block as defined below. */ backendRequest?: pulumi.Input; /** * A `backendResponse` block as defined below. */ backendResponse?: pulumi.Input; /** * A `frontendRequest` block as defined below. */ frontendRequest?: pulumi.Input; /** * A `frontendResponse` block as defined below. */ frontendResponse?: pulumi.Input; /** * The HTTP Correlation Protocol to use. Possible values are `None`, `Legacy` or `W3C`. */ httpCorrelationProtocol?: pulumi.Input; /** * The diagnostic identifier for the API Management Service. At this time the supported values are `applicationinsights` and `azuremonitor`. Changing this forces a new resource to be created. */ identifier?: pulumi.Input; /** * Log client IP address. */ logClientIp?: pulumi.Input; /** * The format of the Operation Name for Application Insights telemetries. Possible values are `Name`, and `Url`. */ operationNameFormat?: pulumi.Input; /** * The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; /** * Sampling (%). For high traffic APIs, please read this [documentation](https://docs.microsoft.com/azure/api-management/api-management-howto-app-insights#performance-implications-and-log-sampling) to understand performance implications and log sampling. Valid values are between `0.0` and `100.0`. */ samplingPercentage?: pulumi.Input; /** * Logging verbosity. Possible values are `verbose`, `information` or `error`. */ verbosity?: pulumi.Input; } /** * The set of arguments for constructing a Diagnostic resource. */ export interface DiagnosticArgs { /** * Always log errors. Send telemetry if there is an erroneous condition, regardless of sampling settings. */ alwaysLogErrors?: pulumi.Input; /** * The id of the target API Management Logger where the API Management Diagnostic should be saved. */ apiManagementLoggerId: pulumi.Input; /** * The Name of the API Management Service where this Diagnostic should be created. Changing this forces a new resource to be created. */ apiManagementName: pulumi.Input; /** * A `backendRequest` block as defined below. */ backendRequest?: pulumi.Input; /** * A `backendResponse` block as defined below. */ backendResponse?: pulumi.Input; /** * A `frontendRequest` block as defined below. */ frontendRequest?: pulumi.Input; /** * A `frontendResponse` block as defined below. */ frontendResponse?: pulumi.Input; /** * The HTTP Correlation Protocol to use. Possible values are `None`, `Legacy` or `W3C`. */ httpCorrelationProtocol?: pulumi.Input; /** * The diagnostic identifier for the API Management Service. At this time the supported values are `applicationinsights` and `azuremonitor`. Changing this forces a new resource to be created. */ identifier: pulumi.Input; /** * Log client IP address. */ logClientIp?: pulumi.Input; /** * The format of the Operation Name for Application Insights telemetries. Possible values are `Name`, and `Url`. */ operationNameFormat?: pulumi.Input; /** * The Name of the Resource Group where the API Management Service exists. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; /** * Sampling (%). For high traffic APIs, please read this [documentation](https://docs.microsoft.com/azure/api-management/api-management-howto-app-insights#performance-implications-and-log-sampling) to understand performance implications and log sampling. Valid values are between `0.0` and `100.0`. */ samplingPercentage?: pulumi.Input; /** * Logging verbosity. Possible values are `verbose`, `information` or `error`. */ verbosity?: pulumi.Input; }