"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.RouteTableAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Provides a resource to manage transit router route table association
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as volcengine from "@volcengine/pulumi";
 *
 * const fooTransitRouter = new volcengine.transit_router.TransitRouter("fooTransitRouter", {
 *     transitRouterName: "test-tf-acc",
 *     description: "test-tf-acc",
 * });
 * const fooRouteTable = new volcengine.transit_router.RouteTable("fooRouteTable", {
 *     description: "tf-test-acc-description",
 *     transitRouterRouteTableName: "tf-table-test-acc",
 *     transitRouterId: fooTransitRouter.id,
 * });
 * const fooCustomerGateway = new volcengine.vpn.CustomerGateway("fooCustomerGateway", {
 *     ipAddress: "192.0.1.3",
 *     customerGatewayName: "acc-test",
 *     description: "acc-test",
 * });
 * const fooConnection = new volcengine.vpn.Connection("fooConnection", {
 *     vpnConnectionName: "acc-tf-test",
 *     description: "acc-tf-test",
 *     attachType: "TransitRouter",
 *     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,
 *     logEnabled: false,
 * });
 * const fooVpnAttachment = new volcengine.transit_router.VpnAttachment("fooVpnAttachment", {
 *     zoneId: "cn-beijing-a",
 *     transitRouterAttachmentName: "tf-test-acc",
 *     description: "tf-test-acc-desc",
 *     transitRouterId: fooTransitRouter.id,
 *     vpnConnectionId: fooConnection.id,
 * });
 * const fooRouteTableAssociation = new volcengine.transit_router.RouteTableAssociation("fooRouteTableAssociation", {
 *     transitRouterAttachmentId: fooVpnAttachment.transitRouterAttachmentId,
 *     transitRouterRouteTableId: fooRouteTable.transitRouterRouteTableId,
 * });
 * ```
 *
 * ## Import
 *
 * TransitRouterRouteTableAssociation can be imported using the TransitRouterAttachmentId:TransitRouterRouteTableId, e.g.
 *
 * ```sh
 * $ pulumi import volcengine:transit_router/routeTableAssociation:RouteTableAssociation default tr-attach-13n2l4c****:tr-rt-1i5i8khf9m58gae5kcx6****
 * ```
 */
class RouteTableAssociation extends pulumi.CustomResource {
    /**
     * Get an existing RouteTableAssociation 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 RouteTableAssociation(name, state, Object.assign(Object.assign({}, opts), { id: id }));
    }
    /**
     * Returns true if the given object is an instance of RouteTableAssociation.  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'] === RouteTableAssociation.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["transitRouterAttachmentId"] = state ? state.transitRouterAttachmentId : undefined;
            resourceInputs["transitRouterRouteTableId"] = state ? state.transitRouterRouteTableId : undefined;
        }
        else {
            const args = argsOrState;
            if ((!args || args.transitRouterAttachmentId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'transitRouterAttachmentId'");
            }
            if ((!args || args.transitRouterRouteTableId === undefined) && !opts.urn) {
                throw new Error("Missing required property 'transitRouterRouteTableId'");
            }
            resourceInputs["transitRouterAttachmentId"] = args ? args.transitRouterAttachmentId : undefined;
            resourceInputs["transitRouterRouteTableId"] = args ? args.transitRouterRouteTableId : undefined;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RouteTableAssociation.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RouteTableAssociation = RouteTableAssociation;
/** @internal */
RouteTableAssociation.__pulumiType = 'volcengine:transit_router/routeTableAssociation:RouteTableAssociation';
//# sourceMappingURL=routeTableAssociation.js.map