UNPKG

@upcloud/pulumi-upcloud

Version:

A Pulumi package for creating and managing UpCloud resources.

117 lines 4.48 kB
"use strict"; // *** 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.FileStorage = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Resource for managing UpCloud file storages. See UpCloud [File Storage](https://upcloud.com/products/file-storage/) product page for more details about the service. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as upcloud from "@upcloud/pulumi-upcloud"; * * // Create network for the File Storage * const _this = new upcloud.Network("this", { * name: "file-storage-net-test", * zone: "fi-hel2", * ipNetwork: { * address: "172.16.8.0/24", * dhcp: true, * family: "IPv4", * }, * }); * const example = new upcloud.FileStorage("example", { * name: "example-file-storage-test", * size: 250, * zone: "fi-hel2", * configuredStatus: "stopped", * labels: { * environment: "staging", * customer: "example-customer", * }, * networks: [{ * family: "IPv4", * name: "example-private-net", * uuid: _this.id, * ipAddress: "172.16.8.11", * }], * }); * const exampleFileStorageShare = new upcloud.FileStorageShare("example", { * fileStorage: example.id, * name: "write-to-project", * path: "/project", * }); * const exampleFileStorageShareAcl = new upcloud.FileStorageShareAcl("example", { * fileStorage: example.id, * shareName: exampleFileStorageShare.name, * name: "acl-for-project", * target: "172.16.8.12", * permission: "rw", * }); * ``` */ class FileStorage extends pulumi.CustomResource { /** * Get an existing FileStorage 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 FileStorage(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of FileStorage. 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'] === FileStorage.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["configuredStatus"] = state?.configuredStatus; resourceInputs["labels"] = state?.labels; resourceInputs["name"] = state?.name; resourceInputs["networks"] = state?.networks; resourceInputs["size"] = state?.size; resourceInputs["zone"] = state?.zone; } else { const args = argsOrState; if (args?.configuredStatus === undefined && !opts.urn) { throw new Error("Missing required property 'configuredStatus'"); } if (args?.size === undefined && !opts.urn) { throw new Error("Missing required property 'size'"); } if (args?.zone === undefined && !opts.urn) { throw new Error("Missing required property 'zone'"); } resourceInputs["configuredStatus"] = args?.configuredStatus; resourceInputs["labels"] = args?.labels; resourceInputs["name"] = args?.name; resourceInputs["networks"] = args?.networks; resourceInputs["size"] = args?.size; resourceInputs["zone"] = args?.zone; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FileStorage.__pulumiType, name, resourceInputs, opts); } } exports.FileStorage = FileStorage; /** @internal */ FileStorage.__pulumiType = 'upcloud:index/fileStorage:FileStorage'; //# sourceMappingURL=fileStorage.js.map