UNPKG

@upcloud/pulumi-upcloud

Version:

A Pulumi package for creating and managing UpCloud resources.

132 lines 4.89 kB
"use strict"; // *** 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.getStorageOutput = exports.getStorage = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides information on UpCloud [Block Storage](https://upcloud.com/products/block-storage) devices. * * Data source can be used to map storage to other resource based on the ID or just to read some other storage property like zone information. Storage types are: `normal`, `backup`, `cdrom`, and `template`. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as upcloud from "@pulumi/upcloud"; * import * as upcloud from "@upcloud/pulumi-upcloud"; * * // Build server with your latest custom image * // * // Note that when applied new updated image will cause replacement of the old server (debian.example.tld) * // with the new server created based on the updated image.This can cause posible data loss * // if it hasn't been taken into account when planning the service. * const appImage = upcloud.getStorage({ * type: "template", * nameRegex: "^app_image.*", * mostRecent: true, * }); * const example = new upcloud.Server("example", { * hostname: "debian.example.tld", * zone: "fi-hel1", * networkInterfaces: [{ * type: "public", * }], * template: { * storage: appImage.then(appImage => appImage.id), * }, * }); * // Build only new servers with your latest custom image * // * // Use the lifecycle meta-argument to ignore changes in server's template triggered by new image version * const example2 = new upcloud.Server("example2", { * hostname: "debian.example2.tld", * zone: "fi-hel1", * networkInterfaces: [{ * type: "public", * }], * template: { * storage: appImage.then(appImage => appImage.id), * }, * }); * ``` */ function getStorage(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("upcloud:index/getStorage:getStorage", { "accessType": args.accessType, "id": args.id, "mostRecent": args.mostRecent, "name": args.name, "nameRegex": args.nameRegex, "title": args.title, "type": args.type, "zone": args.zone, }, opts); } exports.getStorage = getStorage; /** * Provides information on UpCloud [Block Storage](https://upcloud.com/products/block-storage) devices. * * Data source can be used to map storage to other resource based on the ID or just to read some other storage property like zone information. Storage types are: `normal`, `backup`, `cdrom`, and `template`. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as upcloud from "@pulumi/upcloud"; * import * as upcloud from "@upcloud/pulumi-upcloud"; * * // Build server with your latest custom image * // * // Note that when applied new updated image will cause replacement of the old server (debian.example.tld) * // with the new server created based on the updated image.This can cause posible data loss * // if it hasn't been taken into account when planning the service. * const appImage = upcloud.getStorage({ * type: "template", * nameRegex: "^app_image.*", * mostRecent: true, * }); * const example = new upcloud.Server("example", { * hostname: "debian.example.tld", * zone: "fi-hel1", * networkInterfaces: [{ * type: "public", * }], * template: { * storage: appImage.then(appImage => appImage.id), * }, * }); * // Build only new servers with your latest custom image * // * // Use the lifecycle meta-argument to ignore changes in server's template triggered by new image version * const example2 = new upcloud.Server("example2", { * hostname: "debian.example2.tld", * zone: "fi-hel1", * networkInterfaces: [{ * type: "public", * }], * template: { * storage: appImage.then(appImage => appImage.id), * }, * }); * ``` */ function getStorageOutput(args, opts) { args = args || {}; opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("upcloud:index/getStorage:getStorage", { "accessType": args.accessType, "id": args.id, "mostRecent": args.mostRecent, "name": args.name, "nameRegex": args.nameRegex, "title": args.title, "type": args.type, "zone": args.zone, }, opts); } exports.getStorageOutput = getStorageOutput; //# sourceMappingURL=getStorage.js.map