@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
137 lines • 6.17 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.ServerGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage alb server group
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
* vpcName: "acc-test-vpc",
* cidrBlock: "172.16.0.0/16",
* });
* const fooServerGroup = new volcengine.alb.ServerGroup("fooServerGroup", {
* vpcId: fooVpc.id,
* serverGroupName: "acc-test-server-group",
* description: "acc-test",
* serverGroupType: "instance",
* scheduler: "wlc",
* protocol: "HTTP",
* ipAddressType: "IPv4",
* projectName: "default",
* healthCheck: {
* enabled: "on",
* interval: 3,
* timeout: 3,
* method: "GET",
* domain: "www.test.com",
* uri: "/health",
* httpCode: "http_2xx,http_3xx",
* protocol: "HTTP",
* port: 80,
* httpVersion: "HTTP1.1",
* },
* stickySessionConfig: {
* stickySessionEnabled: "on",
* stickySessionType: "insert",
* cookieTimeout: 1100,
* },
* tags: [{
* key: "key1",
* value: "value2",
* }],
* });
* ```
*
* ## Import
*
* AlbServerGroup can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:alb/serverGroup:ServerGroup default resource_id
* ```
*/
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["createTime"] = state ? state.createTime : undefined;
resourceInputs["crossZoneEnabled"] = state ? state.crossZoneEnabled : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["healthCheck"] = state ? state.healthCheck : undefined;
resourceInputs["ipAddressType"] = state ? state.ipAddressType : undefined;
resourceInputs["listeners"] = state ? state.listeners : undefined;
resourceInputs["projectName"] = state ? state.projectName : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["scheduler"] = state ? state.scheduler : undefined;
resourceInputs["serverCount"] = state ? state.serverCount : undefined;
resourceInputs["serverGroupName"] = state ? state.serverGroupName : undefined;
resourceInputs["serverGroupType"] = state ? state.serverGroupType : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["stickySessionConfig"] = state ? state.stickySessionConfig : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["updateTime"] = state ? state.updateTime : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.vpcId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["crossZoneEnabled"] = args ? args.crossZoneEnabled : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["healthCheck"] = args ? args.healthCheck : undefined;
resourceInputs["ipAddressType"] = args ? args.ipAddressType : undefined;
resourceInputs["projectName"] = args ? args.projectName : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["scheduler"] = args ? args.scheduler : undefined;
resourceInputs["serverGroupName"] = args ? args.serverGroupName : undefined;
resourceInputs["serverGroupType"] = args ? args.serverGroupType : undefined;
resourceInputs["stickySessionConfig"] = args ? args.stickySessionConfig : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["listeners"] = undefined /*out*/;
resourceInputs["serverCount"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["updateTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ServerGroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServerGroup = ServerGroup;
/** @internal */
ServerGroup.__pulumiType = 'volcengine:alb/serverGroup:ServerGroup';
//# sourceMappingURL=serverGroup.js.map