@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
124 lines • 5.53 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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ByoipPrefix = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
* Provides a DigitalOcean BYOIP (Bring Your Own IP) prefix resource. This can be used to
* create, modify, and delete BYOIP prefixes.
*
* BYOIP prefixes allow you to bring your own IP address space to DigitalOcean. You can
* use this feature to maintain your IP reputation or meet specific compliance requirements.
*
* BYOIP prefix provisioning documentation: https://docs.digitalocean.com/products/networking/reserved-ips/how-to/provision-byoip/
*
* Note: By default, newly provisioned BYOIP prefixes are not advertised to the internet. After the initial `pulumi up`, BYOIP provisioning request is initiated and DigitalOcean provisions the prefix, the prefix status changes to Active. At this point, you can initiate advertising prefix to the internet by setting field `advertised = true` and apply the configuration to make your prefix fully usable and accessible from the internet.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* // Create a new BYOIP prefix
* const example = new digitalocean.ByoipPrefix("example", {
* prefix: "192.0.2.0/24",
* signature: prefixSignature,
* region: "nyc3",
* advertised: false,
* });
* ```
*
* ## Import
*
* BYOIP prefixes can be imported using the prefix `uuid`, e.g.
*
* ```sh
* $ pulumi import digitalocean:index/byoipPrefix:ByoipPrefix example 506f78a4-e098-11e5-ad9f-000f53306ae1
* ```
*/
class ByoipPrefix extends pulumi.CustomResource {
/**
* Get an existing ByoipPrefix 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 ByoipPrefix(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'digitalocean:index/byoipPrefix:ByoipPrefix';
/**
* Returns true if the given object is an instance of ByoipPrefix. 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'] === ByoipPrefix.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["advertised"] = state?.advertised;
resourceInputs["failureReason"] = state?.failureReason;
resourceInputs["prefix"] = state?.prefix;
resourceInputs["region"] = state?.region;
resourceInputs["signature"] = state?.signature;
resourceInputs["status"] = state?.status;
resourceInputs["uuid"] = state?.uuid;
}
else {
const args = argsOrState;
if (args?.prefix === undefined && !opts.urn) {
throw new Error("Missing required property 'prefix'");
}
if (args?.region === undefined && !opts.urn) {
throw new Error("Missing required property 'region'");
}
resourceInputs["advertised"] = args?.advertised;
resourceInputs["prefix"] = args?.prefix;
resourceInputs["region"] = args?.region;
resourceInputs["signature"] = args?.signature;
resourceInputs["failureReason"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["uuid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ByoipPrefix.__pulumiType, name, resourceInputs, opts);
}
}
exports.ByoipPrefix = ByoipPrefix;
//# sourceMappingURL=byoipPrefix.js.map