com.pulumi.azure.apimanagement.ApiDiagnostic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.apimanagement;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.apimanagement.ApiDiagnosticArgs;
import com.pulumi.azure.apimanagement.inputs.ApiDiagnosticState;
import com.pulumi.azure.apimanagement.outputs.ApiDiagnosticBackendRequest;
import com.pulumi.azure.apimanagement.outputs.ApiDiagnosticBackendResponse;
import com.pulumi.azure.apimanagement.outputs.ApiDiagnosticFrontendRequest;
import com.pulumi.azure.apimanagement.outputs.ApiDiagnosticFrontendResponse;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages a API Management Service API Diagnostics Logs.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.appinsights.Insights;
* import com.pulumi.azure.appinsights.InsightsArgs;
* import com.pulumi.azure.apimanagement.Service;
* import com.pulumi.azure.apimanagement.ServiceArgs;
* import com.pulumi.azure.apimanagement.Api;
* import com.pulumi.azure.apimanagement.ApiArgs;
* import com.pulumi.azure.apimanagement.inputs.ApiImportArgs;
* import com.pulumi.azure.apimanagement.Logger;
* import com.pulumi.azure.apimanagement.LoggerArgs;
* import com.pulumi.azure.apimanagement.inputs.LoggerApplicationInsightsArgs;
* import com.pulumi.azure.apimanagement.ApiDiagnostic;
* import com.pulumi.azure.apimanagement.ApiDiagnosticArgs;
* import com.pulumi.azure.apimanagement.inputs.ApiDiagnosticFrontendRequestArgs;
* import com.pulumi.azure.apimanagement.inputs.ApiDiagnosticFrontendResponseArgs;
* import com.pulumi.azure.apimanagement.inputs.ApiDiagnosticBackendRequestArgs;
* import com.pulumi.azure.apimanagement.inputs.ApiDiagnosticBackendResponseArgs;
* 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 }{{@code
* public static void main(String[] args) }{{@code
* Pulumi.run(App::stack);
* }}{@code
*
* public static void stack(Context ctx) }{{@code
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
*
* var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
* .name("example-appinsights")
* .location(example.location())
* .resourceGroupName(example.name())
* .applicationType("web")
* .build());
*
* var exampleService = new Service("exampleService", ServiceArgs.builder()
* .name("example-apim")
* .location(example.location())
* .resourceGroupName(example.name())
* .publisherName("My Company")
* .publisherEmail("company}{@literal @}{@code mycompany.io")
* .skuName("Developer_1")
* .build());
*
* var exampleApi = new Api("exampleApi", ApiArgs.builder()
* .name("example-api")
* .resourceGroupName(example.name())
* .apiManagementName(exampleService.name())
* .revision("1")
* .displayName("Example API")
* .path("example")
* .protocols("https")
* .import_(ApiImportArgs.builder()
* .contentFormat("swagger-link-json")
* .contentValue("http://conferenceapi.azurewebsites.net/?format=json")
* .build())
* .build());
*
* var exampleLogger = new Logger("exampleLogger", LoggerArgs.builder()
* .name("example-apimlogger")
* .apiManagementName(exampleService.name())
* .resourceGroupName(example.name())
* .applicationInsights(LoggerApplicationInsightsArgs.builder()
* .instrumentationKey(exampleInsights.instrumentationKey())
* .build())
* .build());
*
* var exampleApiDiagnostic = new ApiDiagnostic("exampleApiDiagnostic", ApiDiagnosticArgs.builder()
* .identifier("applicationinsights")
* .resourceGroupName(example.name())
* .apiManagementName(exampleService.name())
* .apiName(exampleApi.name())
* .apiManagementLoggerId(exampleLogger.id())
* .samplingPercentage(5)
* .alwaysLogErrors(true)
* .logClientIp(true)
* .verbosity("verbose")
* .httpCorrelationProtocol("W3C")
* .frontendRequest(ApiDiagnosticFrontendRequestArgs.builder()
* .bodyBytes(32)
* .headersToLogs(
* "content-type",
* "accept",
* "origin")
* .build())
* .frontendResponse(ApiDiagnosticFrontendResponseArgs.builder()
* .bodyBytes(32)
* .headersToLogs(
* "content-type",
* "content-length",
* "origin")
* .build())
* .backendRequest(ApiDiagnosticBackendRequestArgs.builder()
* .bodyBytes(32)
* .headersToLogs(
* "content-type",
* "accept",
* "origin")
* .build())
* .backendResponse(ApiDiagnosticBackendResponseArgs.builder()
* .bodyBytes(32)
* .headersToLogs(
* "content-type",
* "content-length",
* "origin")
* .build())
* .build());
*
* }}{@code
* }}{@code
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* API Management Service API Diagnostics Logs can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:apimanagement/apiDiagnostic:ApiDiagnostic example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/instance1/apis/api1/diagnostics/diagnostic1
* ```
*
*/
@ResourceType(type="azure:apimanagement/apiDiagnostic:ApiDiagnostic")
public class ApiDiagnostic extends com.pulumi.resources.CustomResource {
/**
* Always log errors. Send telemetry if there is an erroneous condition, regardless of sampling settings.
*
*/
@Export(name="alwaysLogErrors", refs={Boolean.class}, tree="[0]")
private Output alwaysLogErrors;
/**
* @return Always log errors. Send telemetry if there is an erroneous condition, regardless of sampling settings.
*
*/
public Output alwaysLogErrors() {
return this.alwaysLogErrors;
}
/**
* The ID (name) of the Diagnostics Logger.
*
*/
@Export(name="apiManagementLoggerId", refs={String.class}, tree="[0]")
private Output apiManagementLoggerId;
/**
* @return The ID (name) of the Diagnostics Logger.
*
*/
public Output apiManagementLoggerId() {
return this.apiManagementLoggerId;
}
/**
* The name of the API Management Service instance. Changing this forces a new API Management Service API Diagnostics Logs to be created.
*
*/
@Export(name="apiManagementName", refs={String.class}, tree="[0]")
private Output apiManagementName;
/**
* @return The name of the API Management Service instance. Changing this forces a new API Management Service API Diagnostics Logs to be created.
*
*/
public Output apiManagementName() {
return this.apiManagementName;
}
/**
* The name of the API on which to configure the Diagnostics Logs. Changing this forces a new API Management Service API Diagnostics Logs to be created.
*
*/
@Export(name="apiName", refs={String.class}, tree="[0]")
private Output apiName;
/**
* @return The name of the API on which to configure the Diagnostics Logs. Changing this forces a new API Management Service API Diagnostics Logs to be created.
*
*/
public Output apiName() {
return this.apiName;
}
/**
* A `backend_request` block as defined below.
*
*/
@Export(name="backendRequest", refs={ApiDiagnosticBackendRequest.class}, tree="[0]")
private Output backendRequest;
/**
* @return A `backend_request` block as defined below.
*
*/
public Output backendRequest() {
return this.backendRequest;
}
/**
* A `backend_response` block as defined below.
*
*/
@Export(name="backendResponse", refs={ApiDiagnosticBackendResponse.class}, tree="[0]")
private Output backendResponse;
/**
* @return A `backend_response` block as defined below.
*
*/
public Output backendResponse() {
return this.backendResponse;
}
/**
* A `frontend_request` block as defined below.
*
*/
@Export(name="frontendRequest", refs={ApiDiagnosticFrontendRequest.class}, tree="[0]")
private Output frontendRequest;
/**
* @return A `frontend_request` block as defined below.
*
*/
public Output frontendRequest() {
return this.frontendRequest;
}
/**
* A `frontend_response` block as defined below.
*
*/
@Export(name="frontendResponse", refs={ApiDiagnosticFrontendResponse.class}, tree="[0]")
private Output frontendResponse;
/**
* @return A `frontend_response` block as defined below.
*
*/
public Output frontendResponse() {
return this.frontendResponse;
}
/**
* The HTTP Correlation Protocol to use. Possible values are `None`, `Legacy` or `W3C`.
*
*/
@Export(name="httpCorrelationProtocol", refs={String.class}, tree="[0]")
private Output httpCorrelationProtocol;
/**
* @return The HTTP Correlation Protocol to use. Possible values are `None`, `Legacy` or `W3C`.
*
*/
public Output httpCorrelationProtocol() {
return this.httpCorrelationProtocol;
}
/**
* Identifier of the Diagnostics Logs. Possible values are `applicationinsights` and `azuremonitor`. Changing this forces a new API Management Service API Diagnostics Logs to be created.
*
*/
@Export(name="identifier", refs={String.class}, tree="[0]")
private Output identifier;
/**
* @return Identifier of the Diagnostics Logs. Possible values are `applicationinsights` and `azuremonitor`. Changing this forces a new API Management Service API Diagnostics Logs to be created.
*
*/
public Output identifier() {
return this.identifier;
}
/**
* Log client IP address.
*
*/
@Export(name="logClientIp", refs={Boolean.class}, tree="[0]")
private Output logClientIp;
/**
* @return Log client IP address.
*
*/
public Output logClientIp() {
return this.logClientIp;
}
/**
* The format of the Operation Name for Application Insights telemetries. Possible values are `Name`, and `Url`. Defaults to `Name`.
*
*/
@Export(name="operationNameFormat", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> operationNameFormat;
/**
* @return The format of the Operation Name for Application Insights telemetries. Possible values are `Name`, and `Url`. Defaults to `Name`.
*
*/
public Output> operationNameFormat() {
return Codegen.optional(this.operationNameFormat);
}
/**
* The name of the Resource Group where the API Management Service API Diagnostics Logs should exist. Changing this forces a new API Management Service API Diagnostics Logs to be created.
*
*/
@Export(name="resourceGroupName", refs={String.class}, tree="[0]")
private Output resourceGroupName;
/**
* @return The name of the Resource Group where the API Management Service API Diagnostics Logs should exist. Changing this forces a new API Management Service API Diagnostics Logs to be created.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* 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`.
*
*/
@Export(name="samplingPercentage", refs={Double.class}, tree="[0]")
private Output samplingPercentage;
/**
* @return 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`.
*
*/
public Output samplingPercentage() {
return this.samplingPercentage;
}
/**
* Logging verbosity. Possible values are `verbose`, `information` or `error`.
*
*/
@Export(name="verbosity", refs={String.class}, tree="[0]")
private Output verbosity;
/**
* @return Logging verbosity. Possible values are `verbose`, `information` or `error`.
*
*/
public Output verbosity() {
return this.verbosity;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ApiDiagnostic(java.lang.String name) {
this(name, ApiDiagnosticArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ApiDiagnostic(java.lang.String name, ApiDiagnosticArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public ApiDiagnostic(java.lang.String name, ApiDiagnosticArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:apimanagement/apiDiagnostic:ApiDiagnostic", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ApiDiagnostic(java.lang.String name, Output id, @Nullable ApiDiagnosticState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:apimanagement/apiDiagnostic:ApiDiagnostic", name, state, makeResourceOptions(options, id), false);
}
private static ApiDiagnosticArgs makeArgs(ApiDiagnosticArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ApiDiagnosticArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host 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
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static ApiDiagnostic get(java.lang.String name, Output id, @Nullable ApiDiagnosticState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ApiDiagnostic(name, id, state, options);
}
}