// *** 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.synapse;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.synapse.WorkspaceExtendedAuditingPolicyArgs;
import com.pulumi.azure.synapse.inputs.WorkspaceExtendedAuditingPolicyState;
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.Integer;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Synapse Workspace Extended Auditing Policy.
 * 
 * ## Example Usage
 * ```java
 * 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.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.storage.DataLakeGen2Filesystem;
 * import com.pulumi.azure.storage.DataLakeGen2FilesystemArgs;
 * import com.pulumi.azure.synapse.Workspace;
 * import com.pulumi.azure.synapse.WorkspaceArgs;
 * import com.pulumi.azure.synapse.inputs.WorkspaceIdentityArgs;
 * import com.pulumi.azure.synapse.WorkspaceExtendedAuditingPolicy;
 * import com.pulumi.azure.synapse.WorkspaceExtendedAuditingPolicyArgs;
 * 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 exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var exampleAccount = new Account(&#34;exampleAccount&#34;, AccountArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .accountTier(&#34;Standard&#34;)
 *             .accountReplicationType(&#34;LRS&#34;)
 *             .accountKind(&#34;BlobStorage&#34;)
 *             .build());
 * 
 *         var exampleDataLakeGen2Filesystem = new DataLakeGen2Filesystem(&#34;exampleDataLakeGen2Filesystem&#34;, DataLakeGen2FilesystemArgs.builder()        
 *             .storageAccountId(exampleAccount.id())
 *             .build());
 * 
 *         var exampleWorkspace = new Workspace(&#34;exampleWorkspace&#34;, WorkspaceArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .storageDataLakeGen2FilesystemId(exampleDataLakeGen2Filesystem.id())
 *             .sqlAdministratorLogin(&#34;sqladminuser&#34;)
 *             .sqlAdministratorLoginPassword(&#34;H@Sh1CoR3!&#34;)
 *             .identity(WorkspaceIdentityArgs.builder()
 *                 .type(&#34;SystemAssigned&#34;)
 *                 .build())
 *             .build());
 * 
 *         var auditLogs = new Account(&#34;auditLogs&#34;, AccountArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .accountTier(&#34;Standard&#34;)
 *             .accountReplicationType(&#34;LRS&#34;)
 *             .build());
 * 
 *         var exampleWorkspaceExtendedAuditingPolicy = new WorkspaceExtendedAuditingPolicy(&#34;exampleWorkspaceExtendedAuditingPolicy&#34;, WorkspaceExtendedAuditingPolicyArgs.builder()        
 *             .synapseWorkspaceId(exampleWorkspace.id())
 *             .storageEndpoint(auditLogs.primaryBlobEndpoint())
 *             .storageAccountAccessKey(auditLogs.primaryAccessKey())
 *             .storageAccountAccessKeyIsSecondary(false)
 *             .retentionInDays(6)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Synapse Workspace Extended Auditing Policies can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:synapse/workspaceExtendedAuditingPolicy:WorkspaceExtendedAuditingPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Synapse/workspaces/workspace1/extendedAuditingSettings/default
 * ```
 * 
 */
@ResourceType(type="azure:synapse/workspaceExtendedAuditingPolicy:WorkspaceExtendedAuditingPolicy")
public class WorkspaceExtendedAuditingPolicy extends com.pulumi.resources.CustomResource {
    /**
     * Enable audit events to Azure Monitor? To enable server audit events to Azure Monitor, please enable its master database audit events to Azure Monitor. Defaults to `true`.
     * 
     */
    @Export(name="logMonitoringEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> logMonitoringEnabled;

    /**
     * @return Enable audit events to Azure Monitor? To enable server audit events to Azure Monitor, please enable its master database audit events to Azure Monitor. Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> logMonitoringEnabled() {
        return Codegen.optional(this.logMonitoringEnabled);
    }
    /**
     * The number of days to retain logs for in the storage account. Defaults to `0`.
     * 
     */
    @Export(name="retentionInDays", refs={Integer.class}, tree="[0]")
    private Output</* @Nullable */ Integer> retentionInDays;

    /**
     * @return The number of days to retain logs for in the storage account. Defaults to `0`.
     * 
     */
    public Output<Optional<Integer>> retentionInDays() {
        return Codegen.optional(this.retentionInDays);
    }
    /**
     * The access key to use for the auditing storage account.
     * 
     */
    @Export(name="storageAccountAccessKey", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> storageAccountAccessKey;

    /**
     * @return The access key to use for the auditing storage account.
     * 
     */
    public Output<Optional<String>> storageAccountAccessKey() {
        return Codegen.optional(this.storageAccountAccessKey);
    }
    /**
     * Is `storage_account_access_key` value the storage&#39;s secondary key?
     * 
     */
    @Export(name="storageAccountAccessKeyIsSecondary", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> storageAccountAccessKeyIsSecondary;

    /**
     * @return Is `storage_account_access_key` value the storage&#39;s secondary key?
     * 
     */
    public Output<Optional<Boolean>> storageAccountAccessKeyIsSecondary() {
        return Codegen.optional(this.storageAccountAccessKeyIsSecondary);
    }
    /**
     * The blob storage endpoint (e.g. &lt;https://example.blob.core.windows.net&gt;). This blob storage will hold all extended auditing logs.
     * 
     */
    @Export(name="storageEndpoint", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> storageEndpoint;

    /**
     * @return The blob storage endpoint (e.g. &lt;https://example.blob.core.windows.net&gt;). This blob storage will hold all extended auditing logs.
     * 
     */
    public Output<Optional<String>> storageEndpoint() {
        return Codegen.optional(this.storageEndpoint);
    }
    /**
     * The ID of the Synapse workspace to set the extended auditing policy. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="synapseWorkspaceId", refs={String.class}, tree="[0]")
    private Output<String> synapseWorkspaceId;

    /**
     * @return The ID of the Synapse workspace to set the extended auditing policy. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> synapseWorkspaceId() {
        return this.synapseWorkspaceId;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public WorkspaceExtendedAuditingPolicy(String name) {
        this(name, WorkspaceExtendedAuditingPolicyArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public WorkspaceExtendedAuditingPolicy(String name, WorkspaceExtendedAuditingPolicyArgs 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 WorkspaceExtendedAuditingPolicy(String name, WorkspaceExtendedAuditingPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:synapse/workspaceExtendedAuditingPolicy:WorkspaceExtendedAuditingPolicy", name, args == null ? WorkspaceExtendedAuditingPolicyArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private WorkspaceExtendedAuditingPolicy(String name, Output<String> id, @Nullable WorkspaceExtendedAuditingPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:synapse/workspaceExtendedAuditingPolicy:WorkspaceExtendedAuditingPolicy", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .additionalSecretOutputs(List.of(
                "storageAccountAccessKey"
            ))
            .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 WorkspaceExtendedAuditingPolicy get(String name, Output<String> id, @Nullable WorkspaceExtendedAuditingPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new WorkspaceExtendedAuditingPolicy(name, id, state, options);
    }
}
