"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.Resolver = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Resolver resource in Oracle Cloud Infrastructure DNS service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/dns/latest/Resolver
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/dns
 *
 * Updates the specified resolver with your new information.
 *
 * Note: Resolvers are associated with VCNs and created when a VCN is created. Wait until the created VCN's state shows as Available in the OCI Console before updating DNS resolver properties.
 * A VCN cannot be deleted while its resolver has resolver endpoints. Additionally, a resolver endpoint cannot be deleted if it is referenced in the resolver's rules. To remove rules from a resolver, update the resolver resource.
 *
 * Destroy behavior: This resource does not delete the underlying DNS Resolver. The resolver itself is deleted only when the attached VCN is deleted. When this Terraform resource is destroyed, managed properties on the resolver (for example, attached views and rules) are cleared so the VCN can be deleted.
 *
 * Default view behavior on VCN delete: If the resolver's default view contains customer-created zones, deleting the VCN (which deletes the resolver) can convert that default view into a non-protected regular view. That view may persist even if it was never imported into Terraform state. To avoid orphaned resources, either delete the zones from the default view before deleting the VCN, or plan to clean up the resulting view afterward.
 *
 * ## Import
 *
 * Resolvers can be imported using their OCID, e.g.
 *
 * ```sh
 * $ pulumi import oci:Dns/resolver:Resolver test_resolver "id"
 * ```
 */
class Resolver extends pulumi.CustomResource {
    /**
     * Get an existing Resolver 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 Resolver(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:Dns/resolver:Resolver';
    /**
     * Returns true if the given object is an instance of Resolver.  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'] === Resolver.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["attachedVcnId"] = state?.attachedVcnId;
            resourceInputs["attachedViews"] = state?.attachedViews;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["defaultViewId"] = state?.defaultViewId;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["endpoints"] = state?.endpoints;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["isProtected"] = state?.isProtected;
            resourceInputs["resolverId"] = state?.resolverId;
            resourceInputs["rules"] = state?.rules;
            resourceInputs["scope"] = state?.scope;
            resourceInputs["self"] = state?.self;
            resourceInputs["state"] = state?.state;
            resourceInputs["timeCreated"] = state?.timeCreated;
            resourceInputs["timeUpdated"] = state?.timeUpdated;
        }
        else {
            const args = argsOrState;
            if (args?.resolverId === undefined && !opts.urn) {
                throw new Error("Missing required property 'resolverId'");
            }
            resourceInputs["attachedViews"] = args?.attachedViews;
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["resolverId"] = args?.resolverId;
            resourceInputs["rules"] = args?.rules;
            resourceInputs["scope"] = args?.scope;
            resourceInputs["attachedVcnId"] = undefined /*out*/;
            resourceInputs["defaultViewId"] = undefined /*out*/;
            resourceInputs["endpoints"] = undefined /*out*/;
            resourceInputs["isProtected"] = undefined /*out*/;
            resourceInputs["self"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
            resourceInputs["timeUpdated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Resolver.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Resolver = Resolver;
//# sourceMappingURL=resolver.js.map