UNPKG

@ediri/vultr

Version:

A Pulumi package for creating and managing Vultr cloud resources.

195 lines 10.3 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.Instance = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Vultr instance resource. This can be used to create, read, modify, and delete instances on your Vultr account. * * ## Example Usage * * Create a new instance: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vultr from "@ediri/vultr"; * * const myInstance = new vultr.Instance("myInstance", { * osId: 1743, * plan: "vc2-1c-2gb", * region: "sea", * }); * ``` * * Create a new instance with options: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as vultr from "@ediri/vultr"; * * const myInstance = new vultr.Instance("myInstance", { * activationEmail: false, * backups: "enabled", * backupsSchedule: { * type: "daily", * }, * ddosProtection: true, * disablePublicIpv4: true, * enableIpv6: true, * hostname: "my-instance-hostname", * label: "my-instance-label", * osId: 1743, * plan: "vc2-1c-2gb", * region: "sea", * tags: ["my-instance-tag"], * }); * ``` * * ## Import * * Instances can be imported using the instance `ID`, e.g. * * ```sh * $ pulumi import vultr:index/instance:Instance my_instance b6a859c5-b299-49dd-8888-b1abbc517d08 * ``` */ class Instance extends pulumi.CustomResource { /** * Get an existing Instance 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 Instance(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Instance. 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'] === Instance.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["activationEmail"] = state ? state.activationEmail : undefined; resourceInputs["allowedBandwidth"] = state ? state.allowedBandwidth : undefined; resourceInputs["appId"] = state ? state.appId : undefined; resourceInputs["appVariables"] = state ? state.appVariables : undefined; resourceInputs["backups"] = state ? state.backups : undefined; resourceInputs["backupsSchedule"] = state ? state.backupsSchedule : undefined; resourceInputs["dateCreated"] = state ? state.dateCreated : undefined; resourceInputs["ddosProtection"] = state ? state.ddosProtection : undefined; resourceInputs["defaultPassword"] = state ? state.defaultPassword : undefined; resourceInputs["disablePublicIpv4"] = state ? state.disablePublicIpv4 : undefined; resourceInputs["disk"] = state ? state.disk : undefined; resourceInputs["enableIpv6"] = state ? state.enableIpv6 : undefined; resourceInputs["features"] = state ? state.features : undefined; resourceInputs["firewallGroupId"] = state ? state.firewallGroupId : undefined; resourceInputs["gatewayV4"] = state ? state.gatewayV4 : undefined; resourceInputs["hostname"] = state ? state.hostname : undefined; resourceInputs["imageId"] = state ? state.imageId : undefined; resourceInputs["internalIp"] = state ? state.internalIp : undefined; resourceInputs["ipxeChainUrl"] = state ? state.ipxeChainUrl : undefined; resourceInputs["isoId"] = state ? state.isoId : undefined; resourceInputs["kvm"] = state ? state.kvm : undefined; resourceInputs["label"] = state ? state.label : undefined; resourceInputs["mainIp"] = state ? state.mainIp : undefined; resourceInputs["netmaskV4"] = state ? state.netmaskV4 : undefined; resourceInputs["os"] = state ? state.os : undefined; resourceInputs["osId"] = state ? state.osId : undefined; resourceInputs["plan"] = state ? state.plan : undefined; resourceInputs["powerStatus"] = state ? state.powerStatus : undefined; resourceInputs["ram"] = state ? state.ram : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["reservedIpId"] = state ? state.reservedIpId : undefined; resourceInputs["scriptId"] = state ? state.scriptId : undefined; resourceInputs["serverStatus"] = state ? state.serverStatus : undefined; resourceInputs["snapshotId"] = state ? state.snapshotId : undefined; resourceInputs["sshKeyIds"] = state ? state.sshKeyIds : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["userData"] = state ? state.userData : undefined; resourceInputs["userScheme"] = state ? state.userScheme : undefined; resourceInputs["v6MainIp"] = state ? state.v6MainIp : undefined; resourceInputs["v6Network"] = state ? state.v6Network : undefined; resourceInputs["v6NetworkSize"] = state ? state.v6NetworkSize : undefined; resourceInputs["vcpuCount"] = state ? state.vcpuCount : undefined; resourceInputs["vpc2Ids"] = state ? state.vpc2Ids : undefined; resourceInputs["vpcIds"] = state ? state.vpcIds : undefined; } else { const args = argsOrState; if ((!args || args.plan === undefined) && !opts.urn) { throw new Error("Missing required property 'plan'"); } if ((!args || args.region === undefined) && !opts.urn) { throw new Error("Missing required property 'region'"); } resourceInputs["activationEmail"] = args ? args.activationEmail : undefined; resourceInputs["appId"] = args ? args.appId : undefined; resourceInputs["appVariables"] = args ? args.appVariables : undefined; resourceInputs["backups"] = args ? args.backups : undefined; resourceInputs["backupsSchedule"] = args ? args.backupsSchedule : undefined; resourceInputs["ddosProtection"] = args ? args.ddosProtection : undefined; resourceInputs["disablePublicIpv4"] = args ? args.disablePublicIpv4 : undefined; resourceInputs["enableIpv6"] = args ? args.enableIpv6 : undefined; resourceInputs["firewallGroupId"] = args ? args.firewallGroupId : undefined; resourceInputs["hostname"] = args ? args.hostname : undefined; resourceInputs["imageId"] = args ? args.imageId : undefined; resourceInputs["ipxeChainUrl"] = args ? args.ipxeChainUrl : undefined; resourceInputs["isoId"] = args ? args.isoId : undefined; resourceInputs["label"] = args ? args.label : undefined; resourceInputs["osId"] = args ? args.osId : undefined; resourceInputs["plan"] = args ? args.plan : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["reservedIpId"] = args ? args.reservedIpId : undefined; resourceInputs["scriptId"] = args ? args.scriptId : undefined; resourceInputs["snapshotId"] = args ? args.snapshotId : undefined; resourceInputs["sshKeyIds"] = args ? args.sshKeyIds : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["userData"] = args ? args.userData : undefined; resourceInputs["userScheme"] = args ? args.userScheme : undefined; resourceInputs["vpc2Ids"] = args ? args.vpc2Ids : undefined; resourceInputs["vpcIds"] = args ? args.vpcIds : undefined; resourceInputs["allowedBandwidth"] = undefined /*out*/; resourceInputs["dateCreated"] = undefined /*out*/; resourceInputs["defaultPassword"] = undefined /*out*/; resourceInputs["disk"] = undefined /*out*/; resourceInputs["features"] = undefined /*out*/; resourceInputs["gatewayV4"] = undefined /*out*/; resourceInputs["internalIp"] = undefined /*out*/; resourceInputs["kvm"] = undefined /*out*/; resourceInputs["mainIp"] = undefined /*out*/; resourceInputs["netmaskV4"] = undefined /*out*/; resourceInputs["os"] = undefined /*out*/; resourceInputs["powerStatus"] = undefined /*out*/; resourceInputs["ram"] = undefined /*out*/; resourceInputs["serverStatus"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["v6MainIp"] = undefined /*out*/; resourceInputs["v6Network"] = undefined /*out*/; resourceInputs["v6NetworkSize"] = undefined /*out*/; resourceInputs["vcpuCount"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["defaultPassword"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Instance.__pulumiType, name, resourceInputs, opts); } } exports.Instance = Instance; /** @internal */ Instance.__pulumiType = 'vultr:index/instance:Instance'; //# sourceMappingURL=instance.js.map