"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DatabaseVulnerabilityAssessmentRuleBaseline = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Database Vulnerability Assessment Rule Baseline.
 *
 * > **Note:** Database Vulnerability Assessment is currently only available for MS SQL databases.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleServer = new azure.mssql.Server("example", {
 *     name: "mysqlserver",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     version: "12.0",
 *     administratorLogin: "4dm1n157r470r",
 *     administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "accteststorageaccount",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "GRS",
 * });
 * const exampleContainer = new azure.storage.Container("example", {
 *     name: "accteststoragecontainer",
 *     storageAccountName: exampleAccount.name,
 *     containerAccessType: "private",
 * });
 * const exampleServerSecurityAlertPolicy = new azure.mssql.ServerSecurityAlertPolicy("example", {
 *     resourceGroupName: example.name,
 *     serverName: exampleServer.name,
 *     state: "Enabled",
 * });
 * const exampleDatabase = new azure.mssql.Database("example", {
 *     name: "mysqldatabase",
 *     serverId: test.id,
 * });
 * const exampleServerVulnerabilityAssessment = new azure.mssql.ServerVulnerabilityAssessment("example", {
 *     serverSecurityAlertPolicyId: exampleServerSecurityAlertPolicy.id,
 *     storageContainerPath: pulumi.interpolate`${exampleAccount.primaryBlobEndpoint}${exampleContainer.name}/`,
 *     storageAccountAccessKey: exampleAccount.primaryAccessKey,
 * });
 * const exampleDatabaseVulnerabilityAssessmentRuleBaseline = new azure.mssql.DatabaseVulnerabilityAssessmentRuleBaseline("example", {
 *     serverVulnerabilityAssessmentId: exampleServerVulnerabilityAssessment.id,
 *     databaseName: exampleDatabase.name,
 *     ruleId: "VA2065",
 *     baselineName: "master",
 *     baselineResults: [
 *         {
 *             results: [
 *                 "allowedip1",
 *                 "123.123.123.123",
 *                 "123.123.123.123",
 *             ],
 *         },
 *         {
 *             results: [
 *                 "allowedip2",
 *                 "255.255.255.255",
 *                 "255.255.255.255",
 *             ],
 *         },
 *     ],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Sql` - 2023-08-01-preview
 *
 * ## Import
 *
 * Database Vulnerability Assessment Rule Baseline can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:mssql/databaseVulnerabilityAssessmentRuleBaseline:DatabaseVulnerabilityAssessmentRuleBaseline example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acceptanceTestResourceGroup1/providers/Microsoft.Sql/servers/mssqlserver/databases/mysqldatabase/vulnerabilityAssessments/Default/rules/VA2065/baselines/master
 * ```
 */
class DatabaseVulnerabilityAssessmentRuleBaseline extends pulumi.CustomResource {
    /**
     * Get an existing DatabaseVulnerabilityAssessmentRuleBaseline 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 Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new DatabaseVulnerabilityAssessmentRuleBaseline(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:mssql/databaseVulnerabilityAssessmentRuleBaseline:DatabaseVulnerabilityAssessmentRuleBaseline';
    /**
     * Returns true if the given object is an instance of DatabaseVulnerabilityAssessmentRuleBaseline.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === DatabaseVulnerabilityAssessmentRuleBaseline.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["baselineName"] = state?.baselineName;
            resourceInputs["baselineResults"] = state?.baselineResults;
            resourceInputs["databaseName"] = state?.databaseName;
            resourceInputs["ruleId"] = state?.ruleId;
            resourceInputs["serverVulnerabilityAssessmentId"] = state?.serverVulnerabilityAssessmentId;
        }
        else {
            const args = argsOrState;
            if (args?.baselineResults === undefined && !opts.urn) {
                throw new Error("Missing required property 'baselineResults'");
            }
            if (args?.databaseName === undefined && !opts.urn) {
                throw new Error("Missing required property 'databaseName'");
            }
            if (args?.ruleId === undefined && !opts.urn) {
                throw new Error("Missing required property 'ruleId'");
            }
            if (args?.serverVulnerabilityAssessmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'serverVulnerabilityAssessmentId'");
            }
            resourceInputs["baselineName"] = args?.baselineName;
            resourceInputs["baselineResults"] = args?.baselineResults;
            resourceInputs["databaseName"] = args?.databaseName;
            resourceInputs["ruleId"] = args?.ruleId;
            resourceInputs["serverVulnerabilityAssessmentId"] = args?.serverVulnerabilityAssessmentId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(DatabaseVulnerabilityAssessmentRuleBaseline.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DatabaseVulnerabilityAssessmentRuleBaseline = DatabaseVulnerabilityAssessmentRuleBaseline;
//# sourceMappingURL=databaseVulnerabilityAssessmentRuleBaseline.js.map