@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
101 lines • 4.47 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.ByoipPrefix = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = 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 });
}
/**
* 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;
/** @internal */
ByoipPrefix.__pulumiType = 'digitalocean:index/byoipPrefix:ByoipPrefix';
//# sourceMappingURL=byoipPrefix.js.map