Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* MS SQL Database Extended Auditing Policies can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:mssql/databaseExtendedAuditingPolicy:DatabaseExtendedAuditingPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlServer1/databases/db1/extendedAuditingSettings/default
* ```
*
*/
@ResourceType(type="azure:mssql/databaseExtendedAuditingPolicy:DatabaseExtendedAuditingPolicy")
public class DatabaseExtendedAuditingPolicy extends com.pulumi.resources.CustomResource {
/**
* The ID of the SQL database to set the extended auditing policy. Changing this forces a new resource to be created.
*
*/
@Export(name="databaseId", refs={String.class}, tree="[0]")
private Output databaseId;
/**
* @return The ID of the SQL database to set the extended auditing policy. Changing this forces a new resource to be created.
*
*/
public Output databaseId() {
return this.databaseId;
}
/**
* Whether to enable the extended auditing policy. Possible values are `true` and `false`. Defaults to `true`.
*
* ->**NOTE:** If `enabled` is `true`, `storage_endpoint` or `log_monitoring_enabled` are required.
*
*/
@Export(name="enabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enabled;
/**
* @return Whether to enable the extended auditing policy. Possible values are `true` and `false`. Defaults to `true`.
*
* ->**NOTE:** If `enabled` is `true`, `storage_endpoint` or `log_monitoring_enabled` are required.
*
*/
public Output> enabled() {
return Codegen.optional(this.enabled);
}
/**
* Enable audit events to Azure Monitor? Defaults to `true`.
*
* > **NOTE:** To enable sending audit events to Log Analytics, please refer to the example which can be found in the `./examples/sql-azure/sql_auditing_log_analytics` directory within the GitHub Repository. To enable sending server audit events to Log Analytics, please enable the master database to send audit events to Log Analytics.
* To enable audit events to Eventhub, please refer to the example which can be found in the `./examples/sql-azure/sql_auditing_eventhub` directory within the GitHub Repository.
*
*/
@Export(name="logMonitoringEnabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> logMonitoringEnabled;
/**
* @return Enable audit events to Azure Monitor? Defaults to `true`.
*
* > **NOTE:** To enable sending audit events to Log Analytics, please refer to the example which can be found in the `./examples/sql-azure/sql_auditing_log_analytics` directory within the GitHub Repository. To enable sending server audit events to Log Analytics, please enable the master database to send audit events to Log Analytics.
* To enable audit events to Eventhub, please refer to the example which can be found in the `./examples/sql-azure/sql_auditing_eventhub` directory within the GitHub Repository.
*
*/
public Output> 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> 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> storageAccountAccessKey() {
return Codegen.optional(this.storageAccountAccessKey);
}
/**
* Is `storage_account_access_key` value the storage'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's secondary key?
*
*/
public Output> storageAccountAccessKeyIsSecondary() {
return Codegen.optional(this.storageAccountAccessKeyIsSecondary);
}
/**
* The blob storage endpoint (e.g. <https://example.blob.core.windows.net>). 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. <https://example.blob.core.windows.net>). This blob storage will hold all extended auditing logs.
*
*/
public Output> storageEndpoint() {
return Codegen.optional(this.storageEndpoint);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public DatabaseExtendedAuditingPolicy(java.lang.String name) {
this(name, DatabaseExtendedAuditingPolicyArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public DatabaseExtendedAuditingPolicy(java.lang.String name, DatabaseExtendedAuditingPolicyArgs 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 DatabaseExtendedAuditingPolicy(java.lang.String name, DatabaseExtendedAuditingPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:mssql/databaseExtendedAuditingPolicy:DatabaseExtendedAuditingPolicy", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private DatabaseExtendedAuditingPolicy(java.lang.String name, Output id, @Nullable DatabaseExtendedAuditingPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:mssql/databaseExtendedAuditingPolicy:DatabaseExtendedAuditingPolicy", name, state, makeResourceOptions(options, id), false);
}
private static DatabaseExtendedAuditingPolicyArgs makeArgs(DatabaseExtendedAuditingPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? DatabaseExtendedAuditingPolicyArgs.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(
"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 DatabaseExtendedAuditingPolicy get(java.lang.String name, Output id, @Nullable DatabaseExtendedAuditingPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new DatabaseExtendedAuditingPolicy(name, id, state, options);
}
}