"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.LoadBalancer = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * This resource provides the Load Balancer resource in Oracle Cloud Infrastructure Load Balancer service.
 * Api doc link for the resource: https://docs.oracle.com/iaas/api/#/en/loadbalancer/latest/LoadBalancer
 *
 * Example terraform configs related to the resource : https://github.com/oracle/terraform-provider-oci/tree/master/examples/load_balancer
 *
 * Creates a new load balancer in the specified compartment. For general information about load balancers,
 * see [Overview of the Load Balancing Service](https://docs.cloud.oracle.com/iaas/Content/Balance/Concepts/balanceoverview.htm).
 *
 * For the purposes of access control, you must provide the OCID of the compartment where you want
 * the load balancer to reside. Notice that the load balancer doesn't have to be in the same compartment as the VCN
 * or backend set. If you're not sure which compartment to use, put the load balancer in the same compartment as the VCN.
 * For information about access control and compartments, see
 * [Overview of the IAM Service](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/overview.htm).
 *
 * You must specify a display name for the load balancer. It does not have to be unique, and you can change it.
 *
 * For information about Availability Domains, see
 * [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm).
 * To get a list of Availability Domains, use the `ListAvailabilityDomains` operation
 * in the Identity and Access Management Service API.
 *
 * All Oracle Cloud Infrastructure resources, including load balancers, get an Oracle-assigned,
 * unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID
 * in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type,
 * or by viewing the resource in the Console. Fore more information, see
 * [Resource Identifiers](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
 *
 * When you create a load balancer, the system assigns an IP address.
 * To get the IP address, use the [GetLoadBalancer](https://docs.cloud.oracle.com/iaas/api/#/en/loadbalancer/20170115/LoadBalancer/GetLoadBalancer) operation.
 *
 * ## Supported Aliases
 *
 * * `ociLoadBalancer`
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as oci from "@pulumi/oci";
 *
 * const testLoadBalancer = new oci.loadbalancer.LoadBalancer("test_load_balancer", {
 *     compartmentId: compartmentId,
 *     displayName: loadBalancerDisplayName,
 *     shape: loadBalancerShape,
 *     subnetIds: loadBalancerSubnetIds,
 *     definedTags: {
 *         "Operations.CostCenter": "42",
 *     },
 *     freeformTags: {
 *         Department: "Finance",
 *     },
 *     ipMode: loadBalancerIpMode,
 *     ipv6subnetCidr: loadBalancerIpv6subnetCidr,
 *     isDeleteProtectionEnabled: loadBalancerIsDeleteProtectionEnabled === "true",
 *     isPrivate: loadBalancerIsPrivate === "true",
 *     isRequestIdEnabled: loadBalancerIsRequestIdEnabled === "true",
 *     networkSecurityGroupIds: loadBalancerNetworkSecurityGroupIds,
 *     requestIdHeader: loadBalancerRequestIdHeader,
 *     reservedIps: [{
 *         id: loadBalancerReservedIpsId,
 *     }],
 *     securityAttributes: loadBalancerSecurityAttributes,
 *     shapeDetails: {
 *         maximumBandwidthInMbps: Number(loadBalancerShapeDetailsMaximumBandwidthInMbps),
 *         minimumBandwidthInMbps: Number(loadBalancerShapeDetailsMinimumBandwidthInMbps),
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * LoadBalancers can be imported using the `id`, e.g.
 *
 * ```sh
 * $ pulumi import oci:LoadBalancer/loadBalancer:LoadBalancer test_load_balancer "id"
 * ```
 */
class LoadBalancer extends pulumi.CustomResource {
    /**
     * Get an existing LoadBalancer 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 LoadBalancer(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'oci:LoadBalancer/loadBalancer:LoadBalancer';
    /**
     * Returns true if the given object is an instance of LoadBalancer.  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'] === LoadBalancer.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["compartmentId"] = state?.compartmentId;
            resourceInputs["definedTags"] = state?.definedTags;
            resourceInputs["displayName"] = state?.displayName;
            resourceInputs["freeformTags"] = state?.freeformTags;
            resourceInputs["ipAddressDetails"] = state?.ipAddressDetails;
            resourceInputs["ipAddresses"] = state?.ipAddresses;
            resourceInputs["ipMode"] = state?.ipMode;
            resourceInputs["ipv6subnetCidr"] = state?.ipv6subnetCidr;
            resourceInputs["isDeleteProtectionEnabled"] = state?.isDeleteProtectionEnabled;
            resourceInputs["isPrivate"] = state?.isPrivate;
            resourceInputs["isRequestIdEnabled"] = state?.isRequestIdEnabled;
            resourceInputs["networkSecurityGroupIds"] = state?.networkSecurityGroupIds;
            resourceInputs["requestIdHeader"] = state?.requestIdHeader;
            resourceInputs["reservedIps"] = state?.reservedIps;
            resourceInputs["securityAttributes"] = state?.securityAttributes;
            resourceInputs["shape"] = state?.shape;
            resourceInputs["shapeDetails"] = state?.shapeDetails;
            resourceInputs["state"] = state?.state;
            resourceInputs["subnetIds"] = state?.subnetIds;
            resourceInputs["systemTags"] = state?.systemTags;
            resourceInputs["timeCreated"] = state?.timeCreated;
        }
        else {
            const args = argsOrState;
            if (args?.compartmentId === undefined && !opts.urn) {
                throw new Error("Missing required property 'compartmentId'");
            }
            if (args?.displayName === undefined && !opts.urn) {
                throw new Error("Missing required property 'displayName'");
            }
            if (args?.shape === undefined && !opts.urn) {
                throw new Error("Missing required property 'shape'");
            }
            if (args?.subnetIds === undefined && !opts.urn) {
                throw new Error("Missing required property 'subnetIds'");
            }
            resourceInputs["compartmentId"] = args?.compartmentId;
            resourceInputs["definedTags"] = args?.definedTags;
            resourceInputs["displayName"] = args?.displayName;
            resourceInputs["freeformTags"] = args?.freeformTags;
            resourceInputs["ipMode"] = args?.ipMode;
            resourceInputs["ipv6subnetCidr"] = args?.ipv6subnetCidr;
            resourceInputs["isDeleteProtectionEnabled"] = args?.isDeleteProtectionEnabled;
            resourceInputs["isPrivate"] = args?.isPrivate;
            resourceInputs["isRequestIdEnabled"] = args?.isRequestIdEnabled;
            resourceInputs["networkSecurityGroupIds"] = args?.networkSecurityGroupIds;
            resourceInputs["requestIdHeader"] = args?.requestIdHeader;
            resourceInputs["reservedIps"] = args?.reservedIps;
            resourceInputs["securityAttributes"] = args?.securityAttributes;
            resourceInputs["shape"] = args?.shape;
            resourceInputs["shapeDetails"] = args?.shapeDetails;
            resourceInputs["subnetIds"] = args?.subnetIds;
            resourceInputs["ipAddressDetails"] = undefined /*out*/;
            resourceInputs["ipAddresses"] = undefined /*out*/;
            resourceInputs["state"] = undefined /*out*/;
            resourceInputs["systemTags"] = undefined /*out*/;
            resourceInputs["timeCreated"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(LoadBalancer.__pulumiType, name, resourceInputs, opts);
    }
}
exports.LoadBalancer = LoadBalancer;
//# sourceMappingURL=loadBalancer.js.map