"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.Connection = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage vpn connection
 * ## 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",
 * });
 * ```
 *
 * ## Import
 *
 * VpnConnection can be imported using the id, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:vpn/connection:Connection default vgc-3tex2x1cwd4c6c0v****
 * ```
 */
class Connection extends pulumi.CustomResource {
    /**
     * Get an existing Connection 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 Connection(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of Connection.  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'] === Connection.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["accountId"] = state ? state.accountId : undefined;
            resourceInputs["attachStatus"] = state ? state.attachStatus : undefined;
            resourceInputs["attachType"] = state ? state.attachType : undefined;
            resourceInputs["businessStatus"] = state ? state.businessStatus : undefined;
            resourceInputs["connectStatus"] = state ? state.connectStatus : undefined;
            resourceInputs["creationTime"] = state ? state.creationTime : undefined;
            resourceInputs["customerGatewayId"] = state ? state.customerGatewayId : undefined;
            resourceInputs["deletedTime"] = state ? state.deletedTime : undefined;
            resourceInputs["description"] = state ? state.description : undefined;
            resourceInputs["dpdAction"] = state ? state.dpdAction : undefined;
            resourceInputs["ikeConfigAuthAlg"] = state ? state.ikeConfigAuthAlg : undefined;
            resourceInputs["ikeConfigDhGroup"] = state ? state.ikeConfigDhGroup : undefined;
            resourceInputs["ikeConfigEncAlg"] = state ? state.ikeConfigEncAlg : undefined;
            resourceInputs["ikeConfigLifetime"] = state ? state.ikeConfigLifetime : undefined;
            resourceInputs["ikeConfigLocalId"] = state ? state.ikeConfigLocalId : undefined;
            resourceInputs["ikeConfigMode"] = state ? state.ikeConfigMode : undefined;
            resourceInputs["ikeConfigPsk"] = state ? state.ikeConfigPsk : undefined;
            resourceInputs["ikeConfigRemoteId"] = state ? state.ikeConfigRemoteId : undefined;
            resourceInputs["ikeConfigVersion"] = state ? state.ikeConfigVersion : undefined;
            resourceInputs["ipAddress"] = state ? state.ipAddress : undefined;
            resourceInputs["ipsecConfigAuthAlg"] = state ? state.ipsecConfigAuthAlg : undefined;
            resourceInputs["ipsecConfigDhGroup"] = state ? state.ipsecConfigDhGroup : undefined;
            resourceInputs["ipsecConfigEncAlg"] = state ? state.ipsecConfigEncAlg : undefined;
            resourceInputs["ipsecConfigLifetime"] = state ? state.ipsecConfigLifetime : undefined;
            resourceInputs["localSubnets"] = state ? state.localSubnets : undefined;
            resourceInputs["logEnabled"] = state ? state.logEnabled : undefined;
            resourceInputs["natTraversal"] = state ? state.natTraversal : undefined;
            resourceInputs["negotiateInstantly"] = state ? state.negotiateInstantly : undefined;
            resourceInputs["overdueTime"] = state ? state.overdueTime : undefined;
            resourceInputs["projectName"] = state ? state.projectName : undefined;
            resourceInputs["remoteSubnets"] = state ? state.remoteSubnets : undefined;
            resourceInputs["status"] = state ? state.status : undefined;
            resourceInputs["tags"] = state ? state.tags : undefined;
            resourceInputs["transitRouterId"] = state ? state.transitRouterId : undefined;
            resourceInputs["updateTime"] = state ? state.updateTime : undefined;
            resourceInputs["vpnConnectionId"] = state ? state.vpnConnectionId : undefined;
            resourceInputs["vpnConnectionName"] = state ? state.vpnConnectionName : undefined;
            resourceInputs["vpnGatewayId"] = state ? state.vpnGatewayId : undefined;
            resourceInputs["zoneId"] = state ? state.zoneId : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.customerGatewayId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'customerGatewayId'");
            }
            if ((!args || args.ikeConfigPsk === undefined) && !opts.urn) {
                throw new Error("Missing required property 'ikeConfigPsk'");
            }
            if ((!args || args.localSubnets === undefined) && !opts.urn) {
                throw new Error("Missing required property 'localSubnets'");
            }
            if ((!args || args.remoteSubnets === undefined) && !opts.urn) {
                throw new Error("Missing required property 'remoteSubnets'");
            }
            resourceInputs["attachType"] = args ? args.attachType : undefined;
            resourceInputs["customerGatewayId"] = args ? args.customerGatewayId : undefined;
            resourceInputs["description"] = args ? args.description : undefined;
            resourceInputs["dpdAction"] = args ? args.dpdAction : undefined;
            resourceInputs["ikeConfigAuthAlg"] = args ? args.ikeConfigAuthAlg : undefined;
            resourceInputs["ikeConfigDhGroup"] = args ? args.ikeConfigDhGroup : undefined;
            resourceInputs["ikeConfigEncAlg"] = args ? args.ikeConfigEncAlg : undefined;
            resourceInputs["ikeConfigLifetime"] = args ? args.ikeConfigLifetime : undefined;
            resourceInputs["ikeConfigLocalId"] = args ? args.ikeConfigLocalId : undefined;
            resourceInputs["ikeConfigMode"] = args ? args.ikeConfigMode : undefined;
            resourceInputs["ikeConfigPsk"] = args ? args.ikeConfigPsk : undefined;
            resourceInputs["ikeConfigRemoteId"] = args ? args.ikeConfigRemoteId : undefined;
            resourceInputs["ikeConfigVersion"] = args ? args.ikeConfigVersion : undefined;
            resourceInputs["ipsecConfigAuthAlg"] = args ? args.ipsecConfigAuthAlg : undefined;
            resourceInputs["ipsecConfigDhGroup"] = args ? args.ipsecConfigDhGroup : undefined;
            resourceInputs["ipsecConfigEncAlg"] = args ? args.ipsecConfigEncAlg : undefined;
            resourceInputs["ipsecConfigLifetime"] = args ? args.ipsecConfigLifetime : undefined;
            resourceInputs["localSubnets"] = args ? args.localSubnets : undefined;
            resourceInputs["logEnabled"] = args ? args.logEnabled : undefined;
            resourceInputs["natTraversal"] = args ? args.natTraversal : undefined;
            resourceInputs["negotiateInstantly"] = args ? args.negotiateInstantly : undefined;
            resourceInputs["projectName"] = args ? args.projectName : undefined;
            resourceInputs["remoteSubnets"] = args ? args.remoteSubnets : undefined;
            resourceInputs["tags"] = args ? args.tags : undefined;
            resourceInputs["vpnConnectionName"] = args ? args.vpnConnectionName : undefined;
            resourceInputs["vpnGatewayId"] = args ? args.vpnGatewayId : undefined;
            resourceInputs["accountId"] = undefined /*out*/;
            resourceInputs["attachStatus"] = undefined /*out*/;
            resourceInputs["businessStatus"] = undefined /*out*/;
            resourceInputs["connectStatus"] = undefined /*out*/;
            resourceInputs["creationTime"] = undefined /*out*/;
            resourceInputs["deletedTime"] = undefined /*out*/;
            resourceInputs["ipAddress"] = undefined /*out*/;
            resourceInputs["overdueTime"] = undefined /*out*/;
            resourceInputs["status"] = undefined /*out*/;
            resourceInputs["transitRouterId"] = undefined /*out*/;
            resourceInputs["updateTime"] = undefined /*out*/;
            resourceInputs["vpnConnectionId"] = undefined /*out*/;
            resourceInputs["zoneId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Connection.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Connection = Connection;
/** @internal */
Connection.__pulumiType = 'volcengine:vpn/connection:Connection';
//# sourceMappingURL=connection.js.map