"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.PeerAttachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage transit router peer attachment
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooBandwidthPackage = new volcengine.transit_router.BandwidthPackage("fooBandwidthPackage", {
 *     transitRouterBandwidthPackageName: "acc-tf-test",
 *     description: "acc-test",
 *     bandwidth: 2,
 *     period: 1,
 *     renewType: "Manual",
 *     renewPeriod: 1,
 *     remainRenewTimes: -1,
 * });
 * const fooTransitRouter = new volcengine.transit_router.TransitRouter("fooTransitRouter", {
 *     transitRouterName: "acc-test-tf",
 *     description: "acc-test-tf",
 * });
 * const fooPeerAttachment = new volcengine.transit_router.PeerAttachment("fooPeerAttachment", {
 *     transitRouterId: fooTransitRouter.id,
 *     transitRouterAttachmentName: "acc-test-tf",
 *     description: "tf-test",
 *     peerTransitRouterId: "tr-xxx",
 *     peerTransitRouterRegionId: "cn-xx",
 *     transitRouterBandwidthPackageId: fooBandwidthPackage.id,
 *     bandwidth: 2,
 *     tags: [{
 *         key: "k1",
 *         value: "v1",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * TransitRouterPeerAttachment can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:transit_router/peerAttachment:PeerAttachment default tr-attach-12be67d0yh2io17q7y1au****
 * ```
 */
class PeerAttachment extends pulumi.CustomResource {
    /**
     * Get an existing PeerAttachment 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 PeerAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of PeerAttachment.  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'] === PeerAttachment.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["bandwidth"] = state ? state.bandwidth : undefined;
            resourceInputs["creationTime"] = state ? state.creationTime : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["peerTransitRouterId"] = state ? state.peerTransitRouterId : undefined;
            resourceInputs["peerTransitRouterRegionId"] = state ? state.peerTransitRouterRegionId : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
            resourceInputs["tags"] = state ? state.tags : undefined;
            resourceInputs["transitRouterAttachmentName"] = state ? state.transitRouterAttachmentName : undefined;
            resourceInputs["transitRouterBandwidthPackageId"] = state ? state.transitRouterBandwidthPackageId : undefined;
            resourceInputs["transitRouterId"] = state ? state.transitRouterId : undefined;
            resourceInputs["transitRouterRouteTableId"] = state ? state.transitRouterRouteTableId : undefined;
            resourceInputs["updateTime"] = state ? state.updateTime : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.peerTransitRouterId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'peerTransitRouterId'");
            }
            if ((!args || args.peerTransitRouterRegionId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'peerTransitRouterRegionId'");
            }
            if ((!args || args.transitRouterId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'transitRouterId'");
            }
            resourceInputs["bandwidth"] = args ? args.bandwidth : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["peerTransitRouterId"] = args ? args.peerTransitRouterId : undefined;
            resourceInputs["peerTransitRouterRegionId"] = args ? args.peerTransitRouterRegionId : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["transitRouterAttachmentName"] = args ? args.transitRouterAttachmentName : undefined;
            resourceInputs["transitRouterBandwidthPackageId"] = args ? args.transitRouterBandwidthPackageId : undefined;
            resourceInputs["transitRouterId"] = args ? args.transitRouterId : undefined;
            resourceInputs["creationTime"] = undefined /*out*/;
            resourceInputs["status"] = undefined /*out*/;
            resourceInputs["transitRouterRouteTableId"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(PeerAttachment.__pulumiType, name, resourceInputs, opts);
    }
}
exports.PeerAttachment = PeerAttachment;
/** @internal */
PeerAttachment.__pulumiType = 'volcengine:transit_router/peerAttachment:PeerAttachment';
//# sourceMappingURL=peerAttachment.js.map