@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
138 lines • 6.21 kB
JavaScript
;
// *** 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.VpnAttachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage transit router vpn attachment
* ## 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 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,
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* ```
*
* ## Import
*
* TransitRouterVpnAttachment can be imported using the transitRouterId:attachmentId, e.g.
*
* ```sh
* $ pulumi import volcengine:transit_router/vpnAttachment:VpnAttachment default tr-2d6fr7mzya2gw58ozfes5g2oh:tr-attach-7qthudw0ll6jmc****
* ```
*/
class VpnAttachment extends pulumi.CustomResource {
/**
* Get an existing VpnAttachment 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 VpnAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of VpnAttachment. 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'] === VpnAttachment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["creationTime"] = state ? state.creationTime : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["transitRouterAttachmentId"] = state ? state.transitRouterAttachmentId : undefined;
resourceInputs["transitRouterAttachmentName"] = state ? state.transitRouterAttachmentName : undefined;
resourceInputs["transitRouterId"] = state ? state.transitRouterId : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
resourceInputs["vpnConnectionId"] = state ? state.vpnConnectionId : undefined;
resourceInputs["zoneId"] = state ? state.zoneId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.transitRouterId === undefined) && !opts.urn) {
throw new Error("Missing required property 'transitRouterId'");
}
if ((!args || args.vpnConnectionId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vpnConnectionId'");
}
if ((!args || args.zoneId === undefined) && !opts.urn) {
throw new Error("Missing required property 'zoneId'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["transitRouterAttachmentName"] = args ? args.transitRouterAttachmentName : undefined;
resourceInputs["transitRouterId"] = args ? args.transitRouterId : undefined;
resourceInputs["vpnConnectionId"] = args ? args.vpnConnectionId : undefined;
resourceInputs["zoneId"] = args ? args.zoneId : undefined;
resourceInputs["creationTime"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["transitRouterAttachmentId"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VpnAttachment.__pulumiType, name, resourceInputs, opts);
}
}
exports.VpnAttachment = VpnAttachment;
/** @internal */
VpnAttachment.__pulumiType = 'volcengine:transit_router/vpnAttachment:VpnAttachment';
//# sourceMappingURL=vpnAttachment.js.map