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

com.pulumi.azurenative.insights.ManagementGroupDiagnosticSetting Maven / Gradle / Ivy

There is a newer version: 2.82.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.insights;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.insights.ManagementGroupDiagnosticSettingArgs;
import com.pulumi.azurenative.insights.outputs.ManagementGroupLogSettingsResponse;
import com.pulumi.azurenative.insights.outputs.SystemDataResponse;
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 management group diagnostic setting resource.
 * Azure REST API version: 2021-05-01-preview. Prior API version in Azure Native 1.x: 2020-01-01-preview.
 * 
 * Other available API versions: 2020-01-01-preview.
 * 
 * ## Example Usage
 * ### Creates or Updates the management group diagnostic setting
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.insights.ManagementGroupDiagnosticSetting;
 * import com.pulumi.azurenative.insights.ManagementGroupDiagnosticSettingArgs;
 * import com.pulumi.azurenative.insights.inputs.ManagementGroupLogSettingsArgs;
 * 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 managementGroupDiagnosticSetting = new ManagementGroupDiagnosticSetting("managementGroupDiagnosticSetting", ManagementGroupDiagnosticSettingArgs.builder()
 *             .eventHubAuthorizationRuleId("/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule")
 *             .eventHubName("myeventhub")
 *             .logs(ManagementGroupLogSettingsArgs.builder()
 *                 .categoryGroup("allLogs")
 *                 .enabled(true)
 *                 .build())
 *             .managementGroupId("testChildMG7")
 *             .marketplacePartnerId("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1")
 *             .name("setting1")
 *             .storageAccountId("/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5")
 *             .workspaceId("/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Creates or Updates the management group diagnostic setting for category * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.insights.ManagementGroupDiagnosticSetting;
 * import com.pulumi.azurenative.insights.ManagementGroupDiagnosticSettingArgs;
 * import com.pulumi.azurenative.insights.inputs.ManagementGroupLogSettingsArgs;
 * 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 managementGroupDiagnosticSetting = new ManagementGroupDiagnosticSetting("managementGroupDiagnosticSetting", ManagementGroupDiagnosticSettingArgs.builder()
 *             .eventHubAuthorizationRuleId("/subscriptions/fb9f25f9-5785-4510-a38f-a62f188eb9f8/resourceGroups/montest/providers/microsoft.eventhub/namespaces/mynamespace/authorizationrules/myrule")
 *             .eventHubName("myeventhub")
 *             .logs(            
 *                 ManagementGroupLogSettingsArgs.builder()
 *                     .category("Administrative")
 *                     .enabled(true)
 *                     .build(),
 *                 ManagementGroupLogSettingsArgs.builder()
 *                     .category("Policy")
 *                     .enabled(true)
 *                     .build())
 *             .managementGroupId("testChildMG7")
 *             .marketplacePartnerId("/subscriptions/abcdeabc-1234-1234-ab12-123a1234567a/resourceGroups/test-rg/providers/Microsoft.Datadog/monitors/dd1")
 *             .name("setting1")
 *             .storageAccountId("/subscriptions/bfaef57f-297e-4210-bfe5-27c18cc671f7/resourceGroups/FuncAppRunners/providers/Microsoft.Storage/storageAccounts/testpersonalb6a5")
 *             .workspaceId("/subscriptions/9cf7cc0a-0ba1-4624-bc82-97e1ee25dc45/resourceGroups/mgTest/providers/Microsoft.OperationalInsights/workspaces/mgTestWorkspace")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:insights:ManagementGroupDiagnosticSetting setting1 /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/diagnosticSettings/{name} * ``` * */ @ResourceType(type="azure-native:insights:ManagementGroupDiagnosticSetting") public class ManagementGroupDiagnosticSetting 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,ManagementGroupLogSettingsResponse.class}, tree="[0,1]") private Output> logs; /** * @return The list of logs settings. * */ public Output>> logs() { return Codegen.optional(this.logs); } /** * The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. * */ @Export(name="marketplacePartnerId", refs={String.class}, tree="[0]") private Output marketplacePartnerId; /** * @return The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs. * */ public Output> marketplacePartnerId() { return Codegen.optional(this.marketplacePartnerId); } /** * The name of the resource * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the resource * */ 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); } /** * The system metadata related to this resource. * */ @Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]") private Output systemData; /** * @return The system metadata related to this resource. * */ public Output systemData() { return this.systemData; } /** * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * */ public Output type() { return this.type; } /** * The full ARM resource ID of the 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 full ARM resource ID of the 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 ManagementGroupDiagnosticSetting(java.lang.String name) { this(name, ManagementGroupDiagnosticSettingArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ManagementGroupDiagnosticSetting(java.lang.String name, ManagementGroupDiagnosticSettingArgs 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 ManagementGroupDiagnosticSetting(java.lang.String name, ManagementGroupDiagnosticSettingArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:ManagementGroupDiagnosticSetting", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ManagementGroupDiagnosticSetting(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:ManagementGroupDiagnosticSetting", name, null, makeResourceOptions(options, id), false); } private static ManagementGroupDiagnosticSettingArgs makeArgs(ManagementGroupDiagnosticSettingArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ManagementGroupDiagnosticSettingArgs.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:insights/v20200101preview:ManagementGroupDiagnosticSetting").build()), Output.of(Alias.builder().type("azure-native:insights/v20210501preview:ManagementGroupDiagnosticSetting").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 ManagementGroupDiagnosticSetting get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ManagementGroupDiagnosticSetting(name, id, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy