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

com.pulumi.azurenative.sql.DatabaseThreatDetectionPolicy Maven / Gradle / Ivy

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

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.sql.DatabaseThreatDetectionPolicyArgs;
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.Integer;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Contains information about a database Threat Detection policy.
 * Azure REST API version: 2014-04-01.
 * 
 * ## Example Usage
 * ### Create database security alert policy max
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.sql.DatabaseThreatDetectionPolicy;
 * import com.pulumi.azurenative.sql.DatabaseThreatDetectionPolicyArgs;
 * 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 databaseThreatDetectionPolicy = new DatabaseThreatDetectionPolicy("databaseThreatDetectionPolicy", DatabaseThreatDetectionPolicyArgs.builder()
 *             .databaseName("testdb")
 *             .disabledAlerts("Sql_Injection;Usage_Anomaly;")
 *             .emailAccountAdmins("Enabled")
 *             .emailAddresses("test}{@literal @}{@code microsoft.com;user}{@literal @}{@code microsoft.com")
 *             .resourceGroupName("securityalert-4799")
 *             .retentionDays(6)
 *             .securityAlertPolicyName("default")
 *             .serverName("securityalert-6440")
 *             .state("Enabled")
 *             .storageAccountAccessKey("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==")
 *             .storageEndpoint("https://mystorage.blob.core.windows.net")
 *             .useServerDefault("Enabled")
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * 
 * }
 * 
* ### Create database security alert policy min * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.sql.DatabaseThreatDetectionPolicy;
 * import com.pulumi.azurenative.sql.DatabaseThreatDetectionPolicyArgs;
 * 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 databaseThreatDetectionPolicy = new DatabaseThreatDetectionPolicy("databaseThreatDetectionPolicy", DatabaseThreatDetectionPolicyArgs.builder()
 *             .databaseName("testdb")
 *             .resourceGroupName("securityalert-4799")
 *             .securityAlertPolicyName("default")
 *             .serverName("securityalert-6440")
 *             .state("Enabled")
 *             .storageAccountAccessKey("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD==")
 *             .storageEndpoint("https://mystorage.blob.core.windows.net")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:sql:DatabaseThreatDetectionPolicy default /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName} * ``` * */ @ResourceType(type="azure-native:sql:DatabaseThreatDetectionPolicy") public class DatabaseThreatDetectionPolicy extends com.pulumi.resources.CustomResource { /** * Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action. * */ @Export(name="disabledAlerts", refs={String.class}, tree="[0]") private Output disabledAlerts; /** * @return Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action. * */ public Output> disabledAlerts() { return Codegen.optional(this.disabledAlerts); } /** * Specifies that the alert is sent to the account administrators. * */ @Export(name="emailAccountAdmins", refs={String.class}, tree="[0]") private Output emailAccountAdmins; /** * @return Specifies that the alert is sent to the account administrators. * */ public Output> emailAccountAdmins() { return Codegen.optional(this.emailAccountAdmins); } /** * Specifies the semicolon-separated list of e-mail addresses to which the alert is sent. * */ @Export(name="emailAddresses", refs={String.class}, tree="[0]") private Output emailAddresses; /** * @return Specifies the semicolon-separated list of e-mail addresses to which the alert is sent. * */ public Output> emailAddresses() { return Codegen.optional(this.emailAddresses); } /** * Resource kind. * */ @Export(name="kind", refs={String.class}, tree="[0]") private Output kind; /** * @return Resource kind. * */ public Output kind() { return this.kind; } /** * The geo-location where the resource lives * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return The geo-location where the resource lives * */ public Output> location() { return Codegen.optional(this.location); } /** * Resource name. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Resource name. * */ public Output name() { return this.name; } /** * Specifies the number of days to keep in the Threat Detection audit logs. * */ @Export(name="retentionDays", refs={Integer.class}, tree="[0]") private Output retentionDays; /** * @return Specifies the number of days to keep in the Threat Detection audit logs. * */ public Output> retentionDays() { return Codegen.optional(this.retentionDays); } /** * Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. * */ @Export(name="state", refs={String.class}, tree="[0]") private Output state; /** * @return Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. * */ public Output state() { return this.state; } /** * Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. If state is Enabled, storageEndpoint is required. * */ @Export(name="storageEndpoint", refs={String.class}, tree="[0]") private Output storageEndpoint; /** * @return Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. If state is Enabled, storageEndpoint is required. * */ public Output> storageEndpoint() { return Codegen.optional(this.storageEndpoint); } /** * Resource type. * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Resource type. * */ public Output type() { return this.type; } /** * Specifies whether to use the default server policy. * */ @Export(name="useServerDefault", refs={String.class}, tree="[0]") private Output useServerDefault; /** * @return Specifies whether to use the default server policy. * */ public Output> useServerDefault() { return Codegen.optional(this.useServerDefault); } /** * * @param name The _unique_ name of the resulting resource. */ public DatabaseThreatDetectionPolicy(java.lang.String name) { this(name, DatabaseThreatDetectionPolicyArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public DatabaseThreatDetectionPolicy(java.lang.String name, DatabaseThreatDetectionPolicyArgs 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 DatabaseThreatDetectionPolicy(java.lang.String name, DatabaseThreatDetectionPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:sql:DatabaseThreatDetectionPolicy", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private DatabaseThreatDetectionPolicy(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:sql:DatabaseThreatDetectionPolicy", name, null, makeResourceOptions(options, id), false); } private static DatabaseThreatDetectionPolicyArgs makeArgs(DatabaseThreatDetectionPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? DatabaseThreatDetectionPolicyArgs.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:sql/v20140401:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20180601preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20200202preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20200801preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20201101preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20210201preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20210501preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20210801preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20211101:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20211101preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20220201preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20220501preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20220801preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20221101preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20230201preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20230501preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20230801preview:DatabaseThreatDetectionPolicy").build()), Output.of(Alias.builder().type("azure-native:sql/v20240501preview:DatabaseThreatDetectionPolicy").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 DatabaseThreatDetectionPolicy get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new DatabaseThreatDetectionPolicy(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy