UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

140 lines 6.32 kB
"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.VpcAttachment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage transit router vpc attachment * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@pulumi/volcengine"; * import * as volcengine from "@volcengine/pulumi"; * * const fooTransitRouter = new volcengine.transit_router.TransitRouter("fooTransitRouter", { * transitRouterName: "test-tf-acc", * description: "test-tf-acc", * asn: 4294967293, * }); * const fooZones = volcengine.ecs.getZones({}); * const fooVpc = new volcengine.vpc.Vpc("fooVpc", { * vpcName: "acc-test-vpc-acc", * cidrBlock: "172.16.0.0/16", * }); * const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", { * vpcId: fooVpc.id, * cidrBlock: "172.16.0.0/24", * zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * subnetName: "acc-test-subnet", * }); * const foo2 = new volcengine.vpc.Subnet("foo2", { * vpcId: fooVpc.id, * cidrBlock: "172.16.255.0/24", * zoneId: fooZones.then(fooZones => fooZones.zones?.[1]?.id), * subnetName: "acc-test-subnet2", * }); * const fooVpcAttachment = new volcengine.transit_router.VpcAttachment("fooVpcAttachment", { * transitRouterId: fooTransitRouter.id, * vpcId: fooVpc.id, * attachPoints: [ * { * subnetId: fooSubnet.id, * zoneId: "cn-beijing-a", * }, * { * subnetId: foo2.id, * zoneId: "cn-beijing-b", * }, * ], * transitRouterAttachmentName: "tf-test-acc-vpc-attach", * description: "tf-test-acc-description", * autoPublishRouteEnabled: true, * tags: [{ * key: "k1", * value: "v1", * }], * }); * ``` * * ## Import * * TransitRouterVpcAttachment can be imported using the transitRouterId:attachmentId, e.g. * * ```sh * $ pulumi import volcengine:transit_router/vpcAttachment:VpcAttachment default tr-2d6fr7mzya2gw58ozfes5g2oh:tr-attach-7qthudw0ll6jmc**** * ``` */ class VpcAttachment extends pulumi.CustomResource { /** * Get an existing VpcAttachment 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 VpcAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of VpcAttachment. 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'] === VpcAttachment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["attachPoints"] = state ? state.attachPoints : undefined; resourceInputs["autoPublishRouteEnabled"] = state ? state.autoPublishRouteEnabled : undefined; 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["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.attachPoints === undefined) && !opts.urn) { throw new Error("Missing required property 'attachPoints'"); } if ((!args || args.transitRouterId === undefined) && !opts.urn) { throw new Error("Missing required property 'transitRouterId'"); } if ((!args || args.vpcId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["attachPoints"] = args ? args.attachPoints : undefined; resourceInputs["autoPublishRouteEnabled"] = args ? args.autoPublishRouteEnabled : undefined; 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["vpcId"] = args ? args.vpcId : undefined; resourceInputs["creationTime"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["transitRouterAttachmentId"] = undefined /*out*/; resourceInputs["updateTime"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpcAttachment.__pulumiType, name, resourceInputs, opts); } } exports.VpcAttachment = VpcAttachment; /** @internal */ VpcAttachment.__pulumiType = 'volcengine:transit_router/vpcAttachment:VpcAttachment'; //# sourceMappingURL=vpcAttachment.js.map