All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.aadiam.DiagnosticSetting Maven / Gradle / Ivy

There is a newer version: 2.72.0
Show newest version
// *** 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.azurenative.aadiam;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.aadiam.DiagnosticSettingArgs;
import com.pulumi.azurenative.aadiam.outputs.LogSettingsResponse;
import com.pulumi.core.Alias;
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.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * The diagnostic setting resource.
 * Azure REST API version: 2017-04-01. Prior API version in Azure Native 1.x: 2017-04-01.
 * 
 * Other available API versions: 2017-04-01-preview.
 * 
 * ## Example Usage
 * ### BatchAccountDelete
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.aadiam.DiagnosticSetting;
 * import com.pulumi.azurenative.aadiam.DiagnosticSettingArgs;
 * import com.pulumi.azurenative.aadiam.inputs.LogSettingsArgs;
 * import com.pulumi.azurenative.aadiam.inputs.RetentionPolicyArgs;
 * 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 diagnosticSetting = new DiagnosticSetting("diagnosticSetting", DiagnosticSettingArgs.builder()
 *             .eventHubAuthorizationRuleId("/subscriptions/1a66ce04-b633-4a0b-b2bc-a912ec8986a6/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/eventhubs/myeventhub/authorizationrules/myrule")
 *             .eventHubName("myeventhub")
 *             .logs(LogSettingsArgs.builder()
 *                 .category("AuditLogs")
 *                 .enabled(true)
 *                 .retentionPolicy(RetentionPolicyArgs.builder()
 *                     .days(0)
 *                     .enabled(false)
 *                     .build())
 *                 .build())
 *             .name("mysetting")
 *             .storageAccountId("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/apptest/providers/Microsoft.Storage/storageAccounts/appteststorage1")
 *             .workspaceId("")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:aadiam:DiagnosticSetting mysetting /providers/microsoft.aadiam/diagnosticSettings/{name} * ``` * */ @ResourceType(type="azure-native:aadiam:DiagnosticSetting") public class DiagnosticSetting extends com.pulumi.resources.CustomResource { /** * The resource Id for the event hub authorization rule. * */ @Export(name="eventHubAuthorizationRuleId", refs={String.class}, tree="[0]") private Output eventHubAuthorizationRuleId; /** * @return The resource Id for the event hub authorization rule. * */ public Output> eventHubAuthorizationRuleId() { return Codegen.optional(this.eventHubAuthorizationRuleId); } /** * The name of the event hub. If none is specified, the default event hub will be selected. * */ @Export(name="eventHubName", refs={String.class}, tree="[0]") private Output eventHubName; /** * @return The name of the event hub. If none is specified, the default event hub will be selected. * */ public Output> eventHubName() { return Codegen.optional(this.eventHubName); } /** * The list of logs settings. * */ @Export(name="logs", refs={List.class,LogSettingsResponse.class}, tree="[0,1]") private Output> logs; /** * @return The list of logs settings. * */ public Output>> logs() { return Codegen.optional(this.logs); } /** * Azure resource name * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Azure resource name * */ public Output name() { return this.name; } /** * The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. * */ @Export(name="serviceBusRuleId", refs={String.class}, tree="[0]") private Output serviceBusRuleId; /** * @return The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. * */ public Output> serviceBusRuleId() { return Codegen.optional(this.serviceBusRuleId); } /** * The resource ID of the storage account to which you would like to send Diagnostic Logs. * */ @Export(name="storageAccountId", refs={String.class}, tree="[0]") private Output storageAccountId; /** * @return The resource ID of the storage account to which you would like to send Diagnostic Logs. * */ public Output> storageAccountId() { return Codegen.optional(this.storageAccountId); } /** * Azure resource type * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Azure resource type * */ public Output type() { return this.type; } /** * The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 * */ @Export(name="workspaceId", refs={String.class}, tree="[0]") private Output workspaceId; /** * @return The workspace ID (resource ID of a Log Analytics workspace) for a Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 * */ public Output> workspaceId() { return Codegen.optional(this.workspaceId); } /** * * @param name The _unique_ name of the resulting resource. */ public DiagnosticSetting(java.lang.String name) { this(name, DiagnosticSettingArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public DiagnosticSetting(java.lang.String name, @Nullable DiagnosticSettingArgs 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 DiagnosticSetting(java.lang.String name, @Nullable DiagnosticSettingArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:aadiam:DiagnosticSetting", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private DiagnosticSetting(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:aadiam:DiagnosticSetting", name, null, makeResourceOptions(options, id), false); } private static DiagnosticSettingArgs makeArgs(@Nullable DiagnosticSettingArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? DiagnosticSettingArgs.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()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:aadiam/v20170401:DiagnosticSetting").build()), Output.of(Alias.builder().type("azure-native:aadiam/v20170401preview:DiagnosticSetting").build()) )) .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 options Optional settings to control the behavior of the CustomResource. */ public static DiagnosticSetting get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new DiagnosticSetting(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy