"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.ExpressRouteCircuitConnection = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an Express Route Circuit Connection.
 *
 * ## 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 exampleExpressRoutePort = new azure.network.ExpressRoutePort("example", {
 *     name: "example-erport",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     peeringLocation: "Equinix-Seattle-SE2",
 *     bandwidthInGbps: 10,
 *     encapsulation: "Dot1Q",
 * });
 * const exampleExpressRouteCircuit = new azure.network.ExpressRouteCircuit("example", {
 *     name: "example-ercircuit",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     expressRoutePortId: exampleExpressRoutePort.id,
 *     bandwidthInGbps: 5,
 *     sku: {
 *         tier: "Standard",
 *         family: "MeteredData",
 *     },
 * });
 * const example2 = new azure.network.ExpressRoutePort("example2", {
 *     name: "example-erport2",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     peeringLocation: "Allied-Toronto-King-West",
 *     bandwidthInGbps: 10,
 *     encapsulation: "Dot1Q",
 * });
 * const example2ExpressRouteCircuit = new azure.network.ExpressRouteCircuit("example2", {
 *     name: "example-ercircuit2",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     expressRoutePortId: example2.id,
 *     bandwidthInGbps: 5,
 *     sku: {
 *         tier: "Standard",
 *         family: "MeteredData",
 *     },
 * });
 * const exampleExpressRouteCircuitPeering = new azure.network.ExpressRouteCircuitPeering("example", {
 *     peeringType: "AzurePrivatePeering",
 *     expressRouteCircuitName: exampleExpressRouteCircuit.name,
 *     resourceGroupName: example.name,
 *     sharedKey: "ItsASecret",
 *     peerAsn: 100,
 *     primaryPeerAddressPrefix: "192.168.1.0/30",
 *     secondaryPeerAddressPrefix: "192.168.1.0/30",
 *     vlanId: 100,
 * });
 * const example2ExpressRouteCircuitPeering = new azure.network.ExpressRouteCircuitPeering("example2", {
 *     peeringType: "AzurePrivatePeering",
 *     expressRouteCircuitName: example2ExpressRouteCircuit.name,
 *     resourceGroupName: example.name,
 *     sharedKey: "ItsASecret",
 *     peerAsn: 100,
 *     primaryPeerAddressPrefix: "192.168.1.0/30",
 *     secondaryPeerAddressPrefix: "192.168.1.0/30",
 *     vlanId: 100,
 * });
 * const exampleExpressRouteCircuitConnection = new azure.network.ExpressRouteCircuitConnection("example", {
 *     name: "example-ercircuitconnection",
 *     peeringId: exampleExpressRouteCircuitPeering.id,
 *     peerPeeringId: example2ExpressRouteCircuitPeering.id,
 *     addressPrefixIpv4: "192.169.9.0/29",
 *     authorizationKey: "846a1918-b7a2-4917-b43c-8c4cdaee006a",
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Network` - 2025-01-01
 *
 * ## Import
 *
 * Express Route Circuit Connections can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:network/expressRouteCircuitConnection:ExpressRouteCircuitConnection example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/expressRouteCircuits/circuit1/peerings/peering1/connections/connection1
 * ```
 */
class ExpressRouteCircuitConnection extends pulumi.CustomResource {
    /**
     * Get an existing ExpressRouteCircuitConnection 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 ExpressRouteCircuitConnection(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:network/expressRouteCircuitConnection:ExpressRouteCircuitConnection';
    /**
     * Returns true if the given object is an instance of ExpressRouteCircuitConnection.  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'] === ExpressRouteCircuitConnection.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["addressPrefixIpv4"] = state?.addressPrefixIpv4;
            resourceInputs["addressPrefixIpv6"] = state?.addressPrefixIpv6;
            resourceInputs["authorizationKey"] = state?.authorizationKey;
            resourceInputs["name"] = state?.name;
            resourceInputs["peerPeeringId"] = state?.peerPeeringId;
            resourceInputs["peeringId"] = state?.peeringId;
        }
        else {
            const args = argsOrState;
            if (args?.addressPrefixIpv4 === undefined && !opts.urn) {
                throw new Error("Missing required property 'addressPrefixIpv4'");
            }
            if (args?.peerPeeringId === undefined && !opts.urn) {
                throw new Error("Missing required property 'peerPeeringId'");
            }
            if (args?.peeringId === undefined && !opts.urn) {
                throw new Error("Missing required property 'peeringId'");
            }
            resourceInputs["addressPrefixIpv4"] = args?.addressPrefixIpv4;
            resourceInputs["addressPrefixIpv6"] = args?.addressPrefixIpv6;
            resourceInputs["authorizationKey"] = args?.authorizationKey ? pulumi.secret(args.authorizationKey) : undefined;
            resourceInputs["name"] = args?.name;
            resourceInputs["peerPeeringId"] = args?.peerPeeringId;
            resourceInputs["peeringId"] = args?.peeringId;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["authorizationKey"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(ExpressRouteCircuitConnection.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ExpressRouteCircuitConnection = ExpressRouteCircuitConnection;
//# sourceMappingURL=expressRouteCircuitConnection.js.map