/
getInstanceType.ts
86 lines (80 loc) · 2.66 KB
/
getInstanceType.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// *** 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! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
/**
* Provides information about a Linode instance type
*
* ## Example Usage
*
* The following example shows how one might use this data source to access information about a Linode Instance type.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as linode from "@pulumi/linode";
*
* const defaultInstanceType = pulumi.output(linode.getInstanceType({
* id: "g6-standard-2",
* }));
* ```
*
* ## Attributes
*
* The Linode Instance Type resource exports the following attributes:
*
* * `id` - The ID representing the Linode Type
*
* * `label` - The Linode Type's label is for display purposes only
*
* * `class` - The class of the Linode Type
*
* * `disk` - The Disk size, in MB, of the Linode Type
*
* * `price.0.hourly` - Cost (in US dollars) per hour.
*
* * `price.0.monthly` - Cost (in US dollars) per month.
*
* * `addons.0.backups.0.price.0.hourly` - The cost (in US dollars) per hour to add Backups service.
*
* * `addons.0.backups.0.price.0.monthly` - The cost (in US dollars) per month to add Backups service.
*
* > This content is derived from https://github.com/terraform-providers/terraform-provider-linode/blob/master/website/docs/d/instance_type.html.markdown.
*/
export function getInstanceType(args: GetInstanceTypeArgs, opts?: pulumi.InvokeOptions): Promise<GetInstanceTypeResult> & GetInstanceTypeResult {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
const promise: Promise<GetInstanceTypeResult> = pulumi.runtime.invoke("linode:index/getInstanceType:getInstanceType", {
"id": args.id,
"label": args.label,
}, opts);
return pulumi.utils.liftProperties(promise, opts);
}
/**
* A collection of arguments for invoking getInstanceType.
*/
export interface GetInstanceTypeArgs {
/**
* Label used to identify instance type
*/
readonly id: string;
readonly label?: string;
}
/**
* A collection of values returned by getInstanceType.
*/
export interface GetInstanceTypeResult {
readonly addons: { backups: { price: { hourly: number, monthly: number } } };
readonly class: string;
readonly disk: number;
readonly id: string;
readonly label: string;
readonly memory: number;
readonly networkOut: number;
readonly price: { hourly: number, monthly: number };
readonly transfer: number;
readonly vcpus: number;
}