@pulumi/hcloud
Version:
A Pulumi package for creating and managing hcloud cloud resources.
86 lines • 2.69 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.getImageOutput = exports.getImage = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const byId = hcloud.getImage({
* id: 114690387,
* });
* const byNameX86 = hcloud.getImage({
* name: "debian-12",
* withArchitecture: "x86",
* });
* const byNameArm = hcloud.getImage({
* name: "debian-12",
* withArchitecture: "arm",
* });
* const byLabel = hcloud.getImage({
* withSelector: "key=value",
* });
* const main = new hcloud.Server("main", {image: byName.id});
* ```
*/
function getImage(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("hcloud:index/getImage:getImage", {
"id": args.id,
"includeDeprecated": args.includeDeprecated,
"mostRecent": args.mostRecent,
"name": args.name,
"selector": args.selector,
"withArchitecture": args.withArchitecture,
"withSelector": args.withSelector,
"withStatuses": args.withStatuses,
}, opts);
}
exports.getImage = getImage;
/**
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as hcloud from "@pulumi/hcloud";
*
* const byId = hcloud.getImage({
* id: 114690387,
* });
* const byNameX86 = hcloud.getImage({
* name: "debian-12",
* withArchitecture: "x86",
* });
* const byNameArm = hcloud.getImage({
* name: "debian-12",
* withArchitecture: "arm",
* });
* const byLabel = hcloud.getImage({
* withSelector: "key=value",
* });
* const main = new hcloud.Server("main", {image: byName.id});
* ```
*/
function getImageOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("hcloud:index/getImage:getImage", {
"id": args.id,
"includeDeprecated": args.includeDeprecated,
"mostRecent": args.mostRecent,
"name": args.name,
"selector": args.selector,
"withArchitecture": args.withArchitecture,
"withSelector": args.withSelector,
"withStatuses": args.withStatuses,
}, opts);
}
exports.getImageOutput = getImageOutput;
//# sourceMappingURL=getImage.js.map