UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

107 lines 4.39 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.ServerGroup = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage server group * ## 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 fooClb = new volcengine.clb.Clb("fooClb", { * type: "public", * subnetId: fooSubnet.id, * loadBalancerSpec: "small_1", * description: "acc0Demo", * loadBalancerName: "acc-test-create", * eipBillingConfig: { * isp: "BGP", * eipBillingType: "PostPaidByBandwidth", * bandwidth: 1, * }, * }); * const fooServerGroup = new volcengine.clb.ServerGroup("fooServerGroup", { * loadBalancerId: fooClb.id, * serverGroupName: "acc-test-create", * description: "hello demo11", * }); * ``` * * ## Import * * ServerGroup can be imported using the id, e.g. * * ```sh * $ pulumi import volcengine:clb/serverGroup:ServerGroup default rsp-273yv0kir1vk07fap8tt9jtwg * ``` */ class ServerGroup extends pulumi.CustomResource { /** * Get an existing ServerGroup 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 ServerGroup(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ServerGroup. 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'] === ServerGroup.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["addressIpVersion"] = state ? state.addressIpVersion : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["loadBalancerId"] = state ? state.loadBalancerId : undefined; resourceInputs["serverGroupId"] = state ? state.serverGroupId : undefined; resourceInputs["serverGroupName"] = state ? state.serverGroupName : undefined; } else { const args = argsOrState; if ((!args || args.loadBalancerId === undefined) && !opts.urn) { throw new Error("Missing required property 'loadBalancerId'"); } resourceInputs["addressIpVersion"] = args ? args.addressIpVersion : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["loadBalancerId"] = args ? args.loadBalancerId : undefined; resourceInputs["serverGroupId"] = args ? args.serverGroupId : undefined; resourceInputs["serverGroupName"] = args ? args.serverGroupName : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ServerGroup.__pulumiType, name, resourceInputs, opts); } } exports.ServerGroup = ServerGroup; /** @internal */ ServerGroup.__pulumiType = 'volcengine:clb/serverGroup:ServerGroup'; //# sourceMappingURL=serverGroup.js.map