@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
90 lines • 3.84 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.FloatingIpAddress = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents a UpCloud floating IP address resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Create a detached floating IP address.
* const myFloatingAddress = new upcloud.FloatingIpAddress("my_floating_address", {zone: "de-fra1"});
* // Floating IP address assigned to a server resource.
* const example = new upcloud.Server("example", {
* hostname: "terraform.example.tld",
* zone: "de-fra1",
* plan: "1xCPU-1GB",
* template: {
* storage: "Ubuntu Server 20.04 LTS (Focal Fossa)",
* size: 25,
* },
* networkInterfaces: [{
* type: "public",
* }],
* });
* const myNewFloatingAddress = new upcloud.FloatingIpAddress("my_new_floating_address", {macAddress: example.networkInterfaces.apply(networkInterfaces => networkInterfaces?.[0]?.macAddress)});
* ```
*
* ## Import
*
* ```sh
* $ pulumi import upcloud:index/floatingIpAddress:FloatingIpAddress my_new_floating_address 94.237.114.205
* ```
*/
class FloatingIpAddress extends pulumi.CustomResource {
/**
* Get an existing FloatingIpAddress 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 FloatingIpAddress(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FloatingIpAddress. 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'] === FloatingIpAddress.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["access"] = state ? state.access : undefined;
resourceInputs["family"] = state ? state.family : undefined;
resourceInputs["ipAddress"] = state ? state.ipAddress : undefined;
resourceInputs["macAddress"] = state ? state.macAddress : undefined;
resourceInputs["zone"] = state ? state.zone : undefined;
}
else {
const args = argsOrState;
resourceInputs["access"] = args ? args.access : undefined;
resourceInputs["family"] = args ? args.family : undefined;
resourceInputs["macAddress"] = args ? args.macAddress : undefined;
resourceInputs["zone"] = args ? args.zone : undefined;
resourceInputs["ipAddress"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FloatingIpAddress.__pulumiType, name, resourceInputs, opts);
}
}
exports.FloatingIpAddress = FloatingIpAddress;
/** @internal */
FloatingIpAddress.__pulumiType = 'upcloud:index/floatingIpAddress:FloatingIpAddress';
//# sourceMappingURL=floatingIpAddress.js.map