@ediri/vultr
Version:
A Pulumi package for creating and managing Vultr cloud resources.
86 lines • 3.54 kB
JavaScript
;
// *** 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.InstanceIpv4 = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Vultr instance IPv4 resource. This can be used to create, read, and
* modify a IPv4 address. instance is rebooted by default.
*
* ## Example Usage
*
* Create a new IPv4 address for a instance:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vultr from "@ediri/vultr";
*
* const myInstance = new vultr.Instance("myInstance", {
* enableIpv6: true,
* osId: 167,
* plan: "vc2-1c-1gb",
* region: "ewr",
* });
* const myInstanceIpv4 = new vultr.InstanceIpv4("myInstanceIpv4", {
* instanceId: myInstance.id,
* reboot: false,
* });
* ```
*/
class InstanceIpv4 extends pulumi.CustomResource {
/**
* Get an existing InstanceIpv4 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 InstanceIpv4(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of InstanceIpv4. 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'] === InstanceIpv4.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["gateway"] = state ? state.gateway : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["ip"] = state ? state.ip : undefined;
resourceInputs["netmask"] = state ? state.netmask : undefined;
resourceInputs["reboot"] = state ? state.reboot : undefined;
resourceInputs["reverse"] = state ? state.reverse : undefined;
}
else {
const args = argsOrState;
if ((!args || args.instanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["reboot"] = args ? args.reboot : undefined;
resourceInputs["gateway"] = undefined /*out*/;
resourceInputs["ip"] = undefined /*out*/;
resourceInputs["netmask"] = undefined /*out*/;
resourceInputs["reverse"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstanceIpv4.__pulumiType, name, resourceInputs, opts);
}
}
exports.InstanceIpv4 = InstanceIpv4;
/** @internal */
InstanceIpv4.__pulumiType = 'vultr:index/instanceIpv4:InstanceIpv4';
//# sourceMappingURL=instanceIpv4.js.map