@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
105 lines • 4.61 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.Instance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a V1 DB instance resource within OpenStack.
*
* > **Note:** All arguments including the instance user password will be stored
* in the raw state as plain-text. Read more about sensitive data in
* state.
*
* ## Example Usage
*
* ### Instance
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const test = new openstack.database.Instance("test", {
* region: "region-test",
* name: "test",
* flavorId: "31792d21-c355-4587-9290-56c1ed0ca376",
* size: 8,
* networks: [{
* uuid: "c0612505-caf2-4fb0-b7cb-56a0240a2b12",
* }],
* datastore: {
* version: "mysql-5.7",
* type: "mysql",
* },
* });
* ```
*/
class Instance extends pulumi.CustomResource {
/**
* Get an existing Instance 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 Instance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Instance. 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'] === Instance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["addresses"] = state ? state.addresses : undefined;
resourceInputs["configurationId"] = state ? state.configurationId : undefined;
resourceInputs["databases"] = state ? state.databases : undefined;
resourceInputs["datastore"] = state ? state.datastore : undefined;
resourceInputs["flavorId"] = state ? state.flavorId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["networks"] = state ? state.networks : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["size"] = state ? state.size : undefined;
resourceInputs["users"] = state ? state.users : undefined;
resourceInputs["volumeType"] = state ? state.volumeType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.datastore === undefined) && !opts.urn) {
throw new Error("Missing required property 'datastore'");
}
if ((!args || args.size === undefined) && !opts.urn) {
throw new Error("Missing required property 'size'");
}
resourceInputs["configurationId"] = args ? args.configurationId : undefined;
resourceInputs["databases"] = args ? args.databases : undefined;
resourceInputs["datastore"] = args ? args.datastore : undefined;
resourceInputs["flavorId"] = args ? args.flavorId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["networks"] = args ? args.networks : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["size"] = args ? args.size : undefined;
resourceInputs["users"] = args ? args.users : undefined;
resourceInputs["volumeType"] = args ? args.volumeType : undefined;
resourceInputs["addresses"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Instance.__pulumiType, name, resourceInputs, opts);
}
}
exports.Instance = Instance;
/** @internal */
Instance.__pulumiType = 'openstack:database/instance:Instance';
//# sourceMappingURL=instance.js.map