@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
80 lines • 3.66 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.ManagedObjectStorageBucket = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents an UpCloud Managed Object Storage bucket.
*
* > This resource uses the UpCloud API to manage the Managed Object Storage buckets. The main difference to S3 API is that the buckets can be deleted even when the bucket contains objects.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* const example = new upcloud.ManagedObjectStorage("example", {
* name: "bucket-example-objstov2",
* region: "europe-1",
* configuredStatus: "started",
* });
* const exampleManagedObjectStorageBucket = new upcloud.ManagedObjectStorageBucket("example", {
* serviceUuid: example.id,
* name: "bucket",
* });
* ```
*/
class ManagedObjectStorageBucket extends pulumi.CustomResource {
/**
* Get an existing ManagedObjectStorageBucket 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 ManagedObjectStorageBucket(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ManagedObjectStorageBucket. 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'] === ManagedObjectStorageBucket.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["serviceUuid"] = state ? state.serviceUuid : undefined;
resourceInputs["totalObjects"] = state ? state.totalObjects : undefined;
resourceInputs["totalSizeBytes"] = state ? state.totalSizeBytes : undefined;
}
else {
const args = argsOrState;
if ((!args || args.serviceUuid === undefined) && !opts.urn) {
throw new Error("Missing required property 'serviceUuid'");
}
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["serviceUuid"] = args ? args.serviceUuid : undefined;
resourceInputs["totalObjects"] = undefined /*out*/;
resourceInputs["totalSizeBytes"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ManagedObjectStorageBucket.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManagedObjectStorageBucket = ManagedObjectStorageBucket;
/** @internal */
ManagedObjectStorageBucket.__pulumiType = 'upcloud:index/managedObjectStorageBucket:ManagedObjectStorageBucket';
//# sourceMappingURL=managedObjectStorageBucket.js.map