@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
125 lines • 5.28 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a V1 Magnum node group resource within OpenStack.
*
* ## Example Usage
*
* ### Create a Nodegroup
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const nodegroup1 = new openstack.containerinfra.NodeGroup("nodegroup_1", {
* name: "nodegroup_1",
* clusterId: "b9a45c5c-cd03-4958-82aa-b80bf93cb922",
* nodeCount: 5,
* });
* ```
*
* ## Attributes reference
*
* The following attributes are exported:
*
* * `region` - See Argument Reference above.
* * `name` - See Argument Reference above.
* * `projectId` - See Argument Reference above.
* * `createdAt` - The time at which node group was created.
* * `updatedAt` - The time at which node group was created.
* * `dockerVolumeSize` - See Argument Reference above.
* * `role` - See Argument Reference above.
* * `imageId` - See Argument Reference above.
* * `flavorId` - See Argument Reference above.
* * `labels` - See Argument Reference above.
* * `nodeCount` - See Argument Reference above.
* * `minNodeCount` - See Argument Reference above.
* * `maxNodeCount` - See Argument Reference above.
* * `role` - See Argument Reference above.
*
* ## Import
*
* Node groups can be imported using the `id` (cluster_id/nodegroup_id), e.g.
*
* ```sh
* $ pulumi import openstack:containerinfra/nodeGroup:NodeGroup nodegroup_1 b9a45c5c-cd03-4958-82aa-b80bf93cb922/ce0f9463-dd25-474b-9fe8-94de63e5e42b
* ```
*/
class NodeGroup extends pulumi.CustomResource {
/**
* Get an existing NodeGroup 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 NodeGroup(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of NodeGroup. 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'] === NodeGroup.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clusterId"] = state?.clusterId;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["dockerVolumeSize"] = state?.dockerVolumeSize;
resourceInputs["flavorId"] = state?.flavorId;
resourceInputs["imageId"] = state?.imageId;
resourceInputs["labels"] = state?.labels;
resourceInputs["maxNodeCount"] = state?.maxNodeCount;
resourceInputs["mergeLabels"] = state?.mergeLabels;
resourceInputs["minNodeCount"] = state?.minNodeCount;
resourceInputs["name"] = state?.name;
resourceInputs["nodeCount"] = state?.nodeCount;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["region"] = state?.region;
resourceInputs["role"] = state?.role;
resourceInputs["updatedAt"] = state?.updatedAt;
}
else {
const args = argsOrState;
if (args?.clusterId === undefined && !opts.urn) {
throw new Error("Missing required property 'clusterId'");
}
resourceInputs["clusterId"] = args?.clusterId;
resourceInputs["dockerVolumeSize"] = args?.dockerVolumeSize;
resourceInputs["flavorId"] = args?.flavorId;
resourceInputs["imageId"] = args?.imageId;
resourceInputs["labels"] = args?.labels;
resourceInputs["maxNodeCount"] = args?.maxNodeCount;
resourceInputs["mergeLabels"] = args?.mergeLabels;
resourceInputs["minNodeCount"] = args?.minNodeCount;
resourceInputs["name"] = args?.name;
resourceInputs["nodeCount"] = args?.nodeCount;
resourceInputs["region"] = args?.region;
resourceInputs["role"] = args?.role;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["projectId"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NodeGroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.NodeGroup = NodeGroup;
/** @internal */
NodeGroup.__pulumiType = 'openstack:containerinfra/nodeGroup:NodeGroup';
//# sourceMappingURL=nodeGroup.js.map