"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.RouteEntry = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage route entry
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@pulumi/volcengine";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooZones = volcengine.ecs.getZones({});
 * const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
 *     vpcName: "acc-test-vpc-rn",
 *     cidrBlock: "172.16.0.0/16",
 * });
 * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
 *     subnetName: "acc-test-subnet-rn",
 *     cidrBlock: "172.16.0.0/24",
 *     zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
 *     vpcId: fooVpc.id,
 * });
 * const fooGateway = new volcengine.nat.Gateway("fooGateway", {
 *     vpcId: fooVpc.id,
 *     subnetId: fooSubnet.id,
 *     spec: "Small",
 *     natGatewayName: "acc-test-nat-rn",
 * });
 * const fooRouteTable = new volcengine.vpc.RouteTable("fooRouteTable", {
 *     vpcId: fooVpc.id,
 *     routeTableName: "acc-test-route-table",
 * });
 * const fooRouteEntry = new volcengine.vpc.RouteEntry("fooRouteEntry", {
 *     routeTableId: fooRouteTable.id,
 *     destinationCidrBlock: "172.16.1.0/24",
 *     nextHopType: "NatGW",
 *     nextHopId: fooGateway.id,
 *     routeEntryName: "acc-test-route-entry",
 * });
 * ```
 *
 * ## Import
 *
 * Route entry can be imported using the route_table_id:route_entry_id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:vpc/routeEntry:RouteEntry default vtb-274e19skkuhog7fap8u4i8ird:rte-274e1g9ei4k5c7fap8sp974fq
 * ```
 */
class RouteEntry extends pulumi.CustomResource {
    /**
     * Get an existing RouteEntry 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 RouteEntry(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of RouteEntry.  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'] === RouteEntry.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["destinationCidrBlock"] = state ? state.destinationCidrBlock : undefined;
            resourceInputs["nextHopId"] = state ? state.nextHopId : undefined;
            resourceInputs["nextHopType"] = state ? state.nextHopType : undefined;
            resourceInputs["routeEntryId"] = state ? state.routeEntryId : undefined;
            resourceInputs["routeEntryName"] = state ? state.routeEntryName : undefined;
            resourceInputs["routeTableId"] = state ? state.routeTableId : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.destinationCidrBlock === undefined) && !opts.urn) {
                throw new Error("Missing required property 'destinationCidrBlock'");
            }
            if ((!args || args.nextHopId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'nextHopId'");
            }
            if ((!args || args.nextHopType === undefined) && !opts.urn) {
                throw new Error("Missing required property 'nextHopType'");
            }
            if ((!args || args.routeTableId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'routeTableId'");
            }
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["destinationCidrBlock"] = args ? args.destinationCidrBlock : undefined;
            resourceInputs["nextHopId"] = args ? args.nextHopId : undefined;
            resourceInputs["nextHopType"] = args ? args.nextHopType : undefined;
            resourceInputs["routeEntryName"] = args ? args.routeEntryName : undefined;
            resourceInputs["routeTableId"] = args ? args.routeTableId : undefined;
            resourceInputs["routeEntryId"] = undefined /*out*/;
            resourceInputs["status"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RouteEntry.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RouteEntry = RouteEntry;
/** @internal */
RouteEntry.__pulumiType = 'volcengine:vpc/routeEntry:RouteEntry';
//# sourceMappingURL=routeEntry.js.map