com.pulumi.azure.appinsights.Insights 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.appinsights;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.appinsights.InsightsArgs;
import com.pulumi.azure.appinsights.inputs.InsightsState;
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.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages an Application Insights component.
*
* ## 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 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) {
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("tf-test")
* .location("West Europe")
* .build());
*
* var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
* .name("tf-test-appinsights")
* .location(example.location())
* .resourceGroupName(example.name())
* .applicationType("web")
* .build());
*
* ctx.export("instrumentationKey", exampleInsights.instrumentationKey());
* ctx.export("appId", exampleInsights.appId());
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ### Workspace Mode
*
* <!--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.operationalinsights.AnalyticsWorkspace;
* import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
* import com.pulumi.azure.appinsights.Insights;
* import com.pulumi.azure.appinsights.InsightsArgs;
* 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) {
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("tf-test")
* .location("West Europe")
* .build());
*
* var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
* .name("workspace-test")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku("PerGB2018")
* .retentionInDays(30)
* .build());
*
* var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
* .name("tf-test-appinsights")
* .location(example.location())
* .resourceGroupName(example.name())
* .workspaceId(exampleAnalyticsWorkspace.id())
* .applicationType("web")
* .build());
*
* ctx.export("instrumentationKey", exampleInsights.instrumentationKey());
* ctx.export("appId", exampleInsights.appId());
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Application Insights instances can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:appinsights/insights:Insights instance1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/components/instance1
* ```
*
*/
@ResourceType(type="azure:appinsights/insights:Insights")
public class Insights extends com.pulumi.resources.CustomResource {
/**
* The App ID associated with this Application Insights component.
*
*/
@Export(name="appId", refs={String.class}, tree="[0]")
private Output appId;
/**
* @return The App ID associated with this Application Insights component.
*
*/
public Output appId() {
return this.appId;
}
/**
* Specifies the type of Application Insights to create. Valid values are `ios` for _iOS_, `java` for _Java web_, `MobileCenter` for _App Center_, `Node.JS` for _Node.js_, `other` for _General_, `phone` for _Windows Phone_, `store` for _Windows Store_ and `web` for _ASP.NET_. Please note these values are case sensitive; unmatched values are treated as _ASP.NET_ by Azure. Changing this forces a new resource to be created.
*
*/
@Export(name="applicationType", refs={String.class}, tree="[0]")
private Output applicationType;
/**
* @return Specifies the type of Application Insights to create. Valid values are `ios` for _iOS_, `java` for _Java web_, `MobileCenter` for _App Center_, `Node.JS` for _Node.js_, `other` for _General_, `phone` for _Windows Phone_, `store` for _Windows Store_ and `web` for _ASP.NET_. Please note these values are case sensitive; unmatched values are treated as _ASP.NET_ by Azure. Changing this forces a new resource to be created.
*
*/
public Output applicationType() {
return this.applicationType;
}
/**
* The Connection String for this Application Insights component. (Sensitive)
*
*/
@Export(name="connectionString", refs={String.class}, tree="[0]")
private Output connectionString;
/**
* @return The Connection String for this Application Insights component. (Sensitive)
*
*/
public Output connectionString() {
return this.connectionString;
}
/**
* Specifies the Application Insights component daily data volume cap in GB. Defaults to `100`.
*
*/
@Export(name="dailyDataCapInGb", refs={Double.class}, tree="[0]")
private Output* @Nullable */ Double> dailyDataCapInGb;
/**
* @return Specifies the Application Insights component daily data volume cap in GB. Defaults to `100`.
*
*/
public Output> dailyDataCapInGb() {
return Codegen.optional(this.dailyDataCapInGb);
}
/**
* Specifies if a notification email will be sent when the daily data volume cap is met. Defaults to `false`.
*
*/
@Export(name="dailyDataCapNotificationsDisabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> dailyDataCapNotificationsDisabled;
/**
* @return Specifies if a notification email will be sent when the daily data volume cap is met. Defaults to `false`.
*
*/
public Output> dailyDataCapNotificationsDisabled() {
return Codegen.optional(this.dailyDataCapNotificationsDisabled);
}
/**
* By default the real client IP is masked as `0.0.0.0` in the logs. Use this argument to disable masking and log the real client IP. Defaults to `false`.
*
*/
@Export(name="disableIpMasking", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> disableIpMasking;
/**
* @return By default the real client IP is masked as `0.0.0.0` in the logs. Use this argument to disable masking and log the real client IP. Defaults to `false`.
*
*/
public Output> disableIpMasking() {
return Codegen.optional(this.disableIpMasking);
}
/**
* Should the Application Insights component force users to create their own storage account for profiling? Defaults to `false`.
*
*/
@Export(name="forceCustomerStorageForProfiler", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> forceCustomerStorageForProfiler;
/**
* @return Should the Application Insights component force users to create their own storage account for profiling? Defaults to `false`.
*
*/
public Output> forceCustomerStorageForProfiler() {
return Codegen.optional(this.forceCustomerStorageForProfiler);
}
/**
* The Instrumentation Key for this Application Insights component. (Sensitive)
*
*/
@Export(name="instrumentationKey", refs={String.class}, tree="[0]")
private Output instrumentationKey;
/**
* @return The Instrumentation Key for this Application Insights component. (Sensitive)
*
*/
public Output instrumentationKey() {
return this.instrumentationKey;
}
/**
* Should the Application Insights component support ingestion over the Public Internet? Defaults to `true`.
*
*/
@Export(name="internetIngestionEnabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> internetIngestionEnabled;
/**
* @return Should the Application Insights component support ingestion over the Public Internet? Defaults to `true`.
*
*/
public Output> internetIngestionEnabled() {
return Codegen.optional(this.internetIngestionEnabled);
}
/**
* Should the Application Insights component support querying over the Public Internet? Defaults to `true`.
*
*/
@Export(name="internetQueryEnabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> internetQueryEnabled;
/**
* @return Should the Application Insights component support querying over the Public Internet? Defaults to `true`.
*
*/
public Output> internetQueryEnabled() {
return Codegen.optional(this.internetQueryEnabled);
}
/**
* Disable Non-Azure AD based Auth. Defaults to `false`.
*
*/
@Export(name="localAuthenticationDisabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> localAuthenticationDisabled;
/**
* @return Disable Non-Azure AD based Auth. Defaults to `false`.
*
*/
public Output> localAuthenticationDisabled() {
return Codegen.optional(this.localAuthenticationDisabled);
}
/**
* Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
*
*/
public Output location() {
return this.location;
}
/**
* Specifies the name of the Application Insights component. Changing this forces a new resource to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return Specifies the name of the Application Insights component. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* The name of the resource group in which to create the Application Insights component. Changing this forces a new resource to be created.
*
*/
@Export(name="resourceGroupName", refs={String.class}, tree="[0]")
private Output resourceGroupName;
/**
* @return The name of the resource group in which to create the Application Insights component. Changing this forces a new resource to be created.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* Specifies the retention period in days. Possible values are `30`, `60`, `90`, `120`, `180`, `270`, `365`, `550` or `730`. Defaults to `90`.
*
*/
@Export(name="retentionInDays", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> retentionInDays;
/**
* @return Specifies the retention period in days. Possible values are `30`, `60`, `90`, `120`, `180`, `270`, `365`, `550` or `730`. Defaults to `90`.
*
*/
public Output> retentionInDays() {
return Codegen.optional(this.retentionInDays);
}
/**
* Specifies the percentage of the data produced by the monitored application that is sampled for Application Insights telemetry. Defaults to `100`.
*
*/
@Export(name="samplingPercentage", refs={Double.class}, tree="[0]")
private Output* @Nullable */ Double> samplingPercentage;
/**
* @return Specifies the percentage of the data produced by the monitored application that is sampled for Application Insights telemetry. Defaults to `100`.
*
*/
public Output> samplingPercentage() {
return Codegen.optional(this.samplingPercentage);
}
/**
* A mapping of tags to assign to the resource.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return A mapping of tags to assign to the resource.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* Specifies the id of a log analytics workspace resource.
*
* > **NOTE:** This can not be removed after set. More details can be found at [Migrate to workspace-based Application Insights resources](https://docs.microsoft.com/azure/azure-monitor/app/convert-classic-resource#migration-process)
*
*/
@Export(name="workspaceId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> workspaceId;
/**
* @return Specifies the id of a log analytics workspace resource.
*
* > **NOTE:** This can not be removed after set. More details can be found at [Migrate to workspace-based Application Insights resources](https://docs.microsoft.com/azure/azure-monitor/app/convert-classic-resource#migration-process)
*
*/
public Output> workspaceId() {
return Codegen.optional(this.workspaceId);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Insights(java.lang.String name) {
this(name, InsightsArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Insights(java.lang.String name, InsightsArgs 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 Insights(java.lang.String name, InsightsArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:appinsights/insights:Insights", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Insights(java.lang.String name, Output id, @Nullable InsightsState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:appinsights/insights:Insights", name, state, makeResourceOptions(options, id), false);
}
private static InsightsArgs makeArgs(InsightsArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? InsightsArgs.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())
.additionalSecretOutputs(List.of(
"connectionString",
"instrumentationKey"
))
.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 Insights get(java.lang.String name, Output id, @Nullable InsightsState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Insights(name, id, state, options);
}
}