UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

125 lines 5.66 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.HaVip = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage ha vip * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@pulumi/volcengine"; * import * as volcengine from "@volcengine/pulumi"; * * const fooZones = volcengine.ecs.getZones({}); * 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: fooZones.then(fooZones => fooZones.zones?.[0]?.id), * vpcId: fooVpc.id, * }); * const fooHaVip = new volcengine.vpc.HaVip("fooHaVip", { * haVipName: "acc-test-ha-vip", * description: "acc-test", * subnetId: fooSubnet.id, * tags: [{ * key: "k1", * value: "v1", * }], * }); * const fooAddress = new volcengine.eip.Address("fooAddress", {billingType: "PostPaidByTraffic"}); * const fooAssociate = new volcengine.eip.Associate("fooAssociate", { * allocationId: fooAddress.id, * instanceId: fooHaVip.id, * instanceType: "HaVip", * }); * ``` * * ## Import * * HaVip can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:vpc/haVip:HaVip default havip-2byzv8icq1b7k2dx0eegb**** * ``` */ class HaVip extends pulumi.CustomResource { /** * Get an existing HaVip 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 HaVip(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of HaVip. 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'] === HaVip.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["associatedEipAddress"] = state ? state.associatedEipAddress : undefined; resourceInputs["associatedEipId"] = state ? state.associatedEipId : undefined; resourceInputs["associatedInstanceIds"] = state ? state.associatedInstanceIds : undefined; resourceInputs["associatedInstanceType"] = state ? state.associatedInstanceType : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["haVipName"] = state ? state.haVipName : undefined; resourceInputs["ipAddress"] = state ? state.ipAddress : undefined; resourceInputs["masterInstanceId"] = state ? state.masterInstanceId : undefined; resourceInputs["projectName"] = state ? state.projectName : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.subnetId === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["haVipName"] = args ? args.haVipName : undefined; resourceInputs["ipAddress"] = args ? args.ipAddress : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["associatedEipAddress"] = undefined /*out*/; resourceInputs["associatedEipId"] = undefined /*out*/; resourceInputs["associatedInstanceIds"] = undefined /*out*/; resourceInputs["associatedInstanceType"] = undefined /*out*/; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["masterInstanceId"] = undefined /*out*/; resourceInputs["projectName"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; resourceInputs["vpcId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(HaVip.__pulumiType, name, resourceInputs, opts); } } exports.HaVip = HaVip; /** @internal */ HaVip.__pulumiType = 'volcengine:vpc/haVip:HaVip'; //# sourceMappingURL=haVip.js.map