"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.ExpressRouteCircuitPeering = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an ExpressRoute Circuit Peering.
 *
 * ## Example Usage
 *
 * ### Creating A Microsoft Peering)
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "exprtTest",
 *     location: "West Europe",
 * });
 * const exampleExpressRouteCircuit = new azure.network.ExpressRouteCircuit("example", {
 *     name: "expressRoute1",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     serviceProviderName: "Equinix",
 *     peeringLocation: "Silicon Valley",
 *     bandwidthInMbps: 50,
 *     sku: {
 *         tier: "Standard",
 *         family: "MeteredData",
 *     },
 *     allowClassicOperations: false,
 *     tags: {
 *         environment: "Production",
 *     },
 * });
 * const exampleExpressRouteCircuitPeering = new azure.network.ExpressRouteCircuitPeering("example", {
 *     peeringType: "MicrosoftPeering",
 *     expressRouteCircuitName: exampleExpressRouteCircuit.name,
 *     resourceGroupName: example.name,
 *     peerAsn: 100,
 *     primaryPeerAddressPrefix: "123.0.0.0/30",
 *     secondaryPeerAddressPrefix: "123.0.0.4/30",
 *     ipv4Enabled: true,
 *     vlanId: 300,
 *     microsoftPeeringConfig: {
 *         advertisedPublicPrefixes: ["123.1.0.0/24"],
 *     },
 *     ipv6: {
 *         primaryPeerAddressPrefix: "2002:db01::/126",
 *         secondaryPeerAddressPrefix: "2003:db01::/126",
 *         enabled: true,
 *         microsoftPeering: {
 *             advertisedPublicPrefixes: ["2002:db01::/126"],
 *         },
 *     },
 * });
 * ```
 *
 * ### Creating Azure Private Peering)
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "exprtTest",
 *     location: "West Europe",
 * });
 * const exampleExpressRouteCircuit = new azure.network.ExpressRouteCircuit("example", {
 *     name: "expressRoute1",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     serviceProviderName: "Equinix",
 *     peeringLocation: "Silicon Valley",
 *     bandwidthInMbps: 50,
 *     sku: {
 *         tier: "Standard",
 *         family: "MeteredData",
 *     },
 *     allowClassicOperations: false,
 *     tags: {
 *         environment: "Production",
 *     },
 * });
 * const exampleExpressRouteCircuitPeering = new azure.network.ExpressRouteCircuitPeering("example", {
 *     peeringType: "AzurePrivatePeering",
 *     expressRouteCircuitName: exampleExpressRouteCircuit.name,
 *     resourceGroupName: example.name,
 *     peerAsn: 100,
 *     primaryPeerAddressPrefix: "123.0.0.0/30",
 *     secondaryPeerAddressPrefix: "123.0.0.4/30",
 *     ipv4Enabled: true,
 *     vlanId: 300,
 *     ipv6: {
 *         primaryPeerAddressPrefix: "2002:db01::/126",
 *         secondaryPeerAddressPrefix: "2003:db01::/126",
 *         enabled: true,
 *     },
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Network` - 2025-01-01
 *
 * ## Import
 *
 * ExpressRoute Circuit Peerings can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:network/expressRouteCircuitPeering:ExpressRouteCircuitPeering peering1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/expressRouteCircuits/myExpressRoute/peerings/peering1
 * ```
 */
class ExpressRouteCircuitPeering extends pulumi.CustomResource {
    /**
     * Get an existing ExpressRouteCircuitPeering 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 ExpressRouteCircuitPeering(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:network/expressRouteCircuitPeering:ExpressRouteCircuitPeering';
    /**
     * Returns true if the given object is an instance of ExpressRouteCircuitPeering.  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'] === ExpressRouteCircuitPeering.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["azureAsn"] = state?.azureAsn;
            resourceInputs["expressRouteCircuitName"] = state?.expressRouteCircuitName;
            resourceInputs["gatewayManagerEtag"] = state?.gatewayManagerEtag;
            resourceInputs["ipv4Enabled"] = state?.ipv4Enabled;
            resourceInputs["ipv6"] = state?.ipv6;
            resourceInputs["microsoftPeeringConfig"] = state?.microsoftPeeringConfig;
            resourceInputs["peerAsn"] = state?.peerAsn;
            resourceInputs["peeringType"] = state?.peeringType;
            resourceInputs["primaryAzurePort"] = state?.primaryAzurePort;
            resourceInputs["primaryPeerAddressPrefix"] = state?.primaryPeerAddressPrefix;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["routeFilterId"] = state?.routeFilterId;
            resourceInputs["secondaryAzurePort"] = state?.secondaryAzurePort;
            resourceInputs["secondaryPeerAddressPrefix"] = state?.secondaryPeerAddressPrefix;
            resourceInputs["sharedKey"] = state?.sharedKey;
            resourceInputs["vlanId"] = state?.vlanId;
        }
        else {
            const args = argsOrState;
            if (args?.expressRouteCircuitName === undefined && !opts.urn) {
                throw new Error("Missing required property 'expressRouteCircuitName'");
            }
            if (args?.peeringType === undefined && !opts.urn) {
                throw new Error("Missing required property 'peeringType'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.vlanId === undefined && !opts.urn) {
                throw new Error("Missing required property 'vlanId'");
            }
            resourceInputs["expressRouteCircuitName"] = args?.expressRouteCircuitName;
            resourceInputs["ipv4Enabled"] = args?.ipv4Enabled;
            resourceInputs["ipv6"] = args?.ipv6;
            resourceInputs["microsoftPeeringConfig"] = args?.microsoftPeeringConfig;
            resourceInputs["peerAsn"] = args?.peerAsn;
            resourceInputs["peeringType"] = args?.peeringType;
            resourceInputs["primaryPeerAddressPrefix"] = args?.primaryPeerAddressPrefix;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["routeFilterId"] = args?.routeFilterId;
            resourceInputs["secondaryPeerAddressPrefix"] = args?.secondaryPeerAddressPrefix;
            resourceInputs["sharedKey"] = args?.sharedKey ? pulumi.secret(args.sharedKey) : undefined;
            resourceInputs["vlanId"] = args?.vlanId;
            resourceInputs["azureAsn"] = undefined /*out*/;
            resourceInputs["gatewayManagerEtag"] = undefined /*out*/;
            resourceInputs["primaryAzurePort"] = undefined /*out*/;
            resourceInputs["secondaryAzurePort"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["sharedKey"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(ExpressRouteCircuitPeering.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ExpressRouteCircuitPeering = ExpressRouteCircuitPeering;
//# sourceMappingURL=expressRouteCircuitPeering.js.map