"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.GatewayRoute = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage vpn gateway route
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
 *     vpcName: "acc-test-vpc",
 *     cidrBlock: "172.16.0.0/16",
 * });
 * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
 *     subnetName: "acc-test-subnet",
 *     cidrBlock: "172.16.0.0/24",
 *     zoneId: "cn-beijing-a",
 *     vpcId: fooVpc.id,
 * });
 * const fooGateway = new volcengine.vpn.Gateway("fooGateway", {
 *     vpcId: fooVpc.id,
 *     subnetId: fooSubnet.id,
 *     bandwidth: 20,
 *     vpnGatewayName: "acc-test",
 *     description: "acc-test",
 *     period: 2,
 *     projectName: "default",
 * });
 * const fooCustomerGateway = new volcengine.vpn.CustomerGateway("fooCustomerGateway", {
 *     ipAddress: "192.0.1.3",
 *     customerGatewayName: "acc-test",
 *     description: "acc-test",
 *     projectName: "default",
 * });
 * const fooConnection = new volcengine.vpn.Connection("fooConnection", {
 *     vpnConnectionName: "acc-tf-test",
 *     description: "acc-tf-test",
 *     vpnGatewayId: fooGateway.id,
 *     customerGatewayId: fooCustomerGateway.id,
 *     localSubnets: ["192.168.0.0/22"],
 *     remoteSubnets: ["192.161.0.0/20"],
 *     dpdAction: "none",
 *     natTraversal: true,
 *     ikeConfigPsk: "acctest@!3",
 *     ikeConfigVersion: "ikev1",
 *     ikeConfigMode: "main",
 *     ikeConfigEncAlg: "aes",
 *     ikeConfigAuthAlg: "md5",
 *     ikeConfigDhGroup: "group2",
 *     ikeConfigLifetime: 9000,
 *     ikeConfigLocalId: "acc_test",
 *     ikeConfigRemoteId: "acc_test",
 *     ipsecConfigEncAlg: "aes",
 *     ipsecConfigAuthAlg: "sha256",
 *     ipsecConfigDhGroup: "group2",
 *     ipsecConfigLifetime: 9000,
 *     projectName: "default",
 *     logEnabled: false,
 * });
 * const fooGatewayRoute = new volcengine.vpn.GatewayRoute("fooGatewayRoute", {
 *     vpnGatewayId: fooGateway.id,
 *     destinationCidrBlock: "192.168.0.0/20",
 *     nextHopId: fooConnection.id,
 * });
 * ```
 *
 * ## Import
 *
 * VpnGatewayRoute can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:vpn/gatewayRoute:GatewayRoute default vgr-3tex2c6c0v844c****
 * ```
 */
class GatewayRoute extends pulumi.CustomResource {
    /**
     * Get an existing GatewayRoute 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 GatewayRoute(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of GatewayRoute.  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'] === GatewayRoute.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["creationTime"] = state ? state.creationTime : undefined;
            resourceInputs["destinationCidrBlock"] = state ? state.destinationCidrBlock : undefined;
            resourceInputs["nextHopId"] = state ? state.nextHopId : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
            resourceInputs["updateTime"] = state ? state.updateTime : undefined;
            resourceInputs["vpnGatewayId"] = state ? state.vpnGatewayId : undefined;
            resourceInputs["vpnGatewayRouteId"] = state ? state.vpnGatewayRouteId : 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.vpnGatewayId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'vpnGatewayId'");
            }
            resourceInputs["destinationCidrBlock"] = args ? args.destinationCidrBlock : undefined;
            resourceInputs["nextHopId"] = args ? args.nextHopId : undefined;
            resourceInputs["vpnGatewayId"] = args ? args.vpnGatewayId : undefined;
            resourceInputs["creationTime"] = undefined /*out*/;
            resourceInputs["status"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
            resourceInputs["vpnGatewayRouteId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(GatewayRoute.__pulumiType, name, resourceInputs, opts);
    }
}
exports.GatewayRoute = GatewayRoute;
/** @internal */
GatewayRoute.__pulumiType = 'volcengine:vpn/gatewayRoute:GatewayRoute';
//# sourceMappingURL=gatewayRoute.js.map