@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
145 lines • 6.16 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.ServerGroupServer = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage server group server
* ## 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",
* });
* const fooSecurityGroup = new volcengine.vpc.SecurityGroup("fooSecurityGroup", {
* vpcId: fooVpc.id,
* securityGroupName: "acc-test-security-group",
* });
* const fooInstance = new volcengine.ecs.Instance("fooInstance", {
* imageId: "image-ycjwwciuzy5pkh54xx8f",
* instanceType: "ecs.c3i.large",
* instanceName: "acc-test-ecs-name",
* password: "93f0cb0614Aab12",
* instanceChargeType: "PostPaid",
* systemVolumeType: "ESSD_PL0",
* systemVolumeSize: 40,
* subnetId: fooSubnet.id,
* securityGroupIds: [fooSecurityGroup.id],
* });
* const fooServerGroupServer = new volcengine.clb.ServerGroupServer("fooServerGroupServer", {
* serverGroupId: fooServerGroup.id,
* instanceId: fooInstance.id,
* type: "ecs",
* weight: 100,
* port: 80,
* description: "This is a acc test server",
* });
* ```
*
* ## Import
*
* ServerGroupServer can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:clb/serverGroupServer:ServerGroupServer default rsp-274xltv2*****8tlv3q3s:rs-3ciynux6i1x4w****rszh49sj
* ```
*/
class ServerGroupServer extends pulumi.CustomResource {
/**
* Get an existing ServerGroupServer 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 ServerGroupServer(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ServerGroupServer. 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'] === ServerGroupServer.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["ip"] = state ? state.ip : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["serverGroupId"] = state ? state.serverGroupId : undefined;
resourceInputs["serverId"] = state ? state.serverId : undefined;
resourceInputs["type"] = state ? state.type : undefined;
resourceInputs["weight"] = state ? state.weight : undefined;
}
else {
const args = argsOrState;
if ((!args || args.instanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
if ((!args || args.port === undefined) && !opts.urn) {
throw new Error("Missing required property 'port'");
}
if ((!args || args.serverGroupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'serverGroupId'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["ip"] = args ? args.ip : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["serverGroupId"] = args ? args.serverGroupId : undefined;
resourceInputs["type"] = args ? args.type : undefined;
resourceInputs["weight"] = args ? args.weight : undefined;
resourceInputs["serverId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServerGroupServer.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServerGroupServer = ServerGroupServer;
/** @internal */
ServerGroupServer.__pulumiType = 'volcengine:clb/serverGroupServer:ServerGroupServer';
//# sourceMappingURL=serverGroupServer.js.map