@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
109 lines • 4.51 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.ManagedObjectStorage = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents an UpCloud Managed Object Storage instance, which provides S3 compatible storage.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Create router for the network
* const _this = new upcloud.Router("this", {name: "object-storage-example-router"});
* // Create network for the Managed Object Storage
* const thisNetwork = new upcloud.Network("this", {
* name: "object-storage-example-net",
* zone: "fi-hel1",
* ipNetwork: {
* address: "172.16.2.0/24",
* dhcp: true,
* family: "IPv4",
* },
* router: _this.id,
* });
* const thisManagedObjectStorage = new upcloud.ManagedObjectStorage("this", {
* name: "example",
* region: "europe-1",
* configuredStatus: "started",
* networks: [{
* family: "IPv4",
* name: "example-private-net",
* type: "private",
* uuid: thisNetwork.id,
* }],
* labels: {
* "managed-by": "terraform",
* },
* });
* ```
*/
class ManagedObjectStorage extends pulumi.CustomResource {
/**
* Get an existing ManagedObjectStorage 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 ManagedObjectStorage(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ManagedObjectStorage. 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'] === ManagedObjectStorage.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["configuredStatus"] = state?.configuredStatus;
resourceInputs["createdAt"] = state?.createdAt;
resourceInputs["endpoints"] = state?.endpoints;
resourceInputs["labels"] = state?.labels;
resourceInputs["name"] = state?.name;
resourceInputs["networks"] = state?.networks;
resourceInputs["operationalState"] = state?.operationalState;
resourceInputs["region"] = state?.region;
resourceInputs["updatedAt"] = state?.updatedAt;
}
else {
const args = argsOrState;
if (args?.configuredStatus === undefined && !opts.urn) {
throw new Error("Missing required property 'configuredStatus'");
}
if (args?.region === undefined && !opts.urn) {
throw new Error("Missing required property 'region'");
}
resourceInputs["configuredStatus"] = args?.configuredStatus;
resourceInputs["labels"] = args?.labels;
resourceInputs["name"] = args?.name;
resourceInputs["networks"] = args?.networks;
resourceInputs["region"] = args?.region;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["endpoints"] = undefined /*out*/;
resourceInputs["operationalState"] = undefined /*out*/;
resourceInputs["updatedAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ManagedObjectStorage.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManagedObjectStorage = ManagedObjectStorage;
/** @internal */
ManagedObjectStorage.__pulumiType = 'upcloud:index/managedObjectStorage:ManagedObjectStorage';
//# sourceMappingURL=managedObjectStorage.js.map