@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
80 lines • 3.49 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.getByoipPrefixResourcesOutput = exports.getByoipPrefixResources = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Get information about IP addresses that have been **already assigned** from a
* BYOIP (Bring Your Own IP) prefix. This data source provides a list of all IP addresses
* that are currently assigned to resources from a specific BYOIP prefix.
*
* **Note:** This data source only lists IPs that are already assigned to resources (like Droplets).
* To allocate new IPs from the BYOIP prefix, you need to use `digitalocean.ReservedIpAssignment` resource.
*
* ## Example Usage
*
* List all assigned IP addresses from a BYOIP prefix:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getByoipPrefix({
* uuid: "506f78a4-e098-11e5-ad9f-000f53306ae1",
* });
* const exampleGetByoipPrefixResources = example.then(example => digitalocean.getByoipPrefixResources({
* byoipPrefixUuid: example.uuid,
* }));
* export const assignedByoipIps = exampleGetByoipPrefixResources.then(exampleGetByoipPrefixResources => .map(addr => ({
* ip: addr.ipAddress,
* region: addr.region,
* assigned: addr.assignedAt,
* })));
* ```
*/
function getByoipPrefixResources(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("digitalocean:index/getByoipPrefixResources:getByoipPrefixResources", {
"byoipPrefixUuid": args.byoipPrefixUuid,
}, opts);
}
exports.getByoipPrefixResources = getByoipPrefixResources;
/**
* Get information about IP addresses that have been **already assigned** from a
* BYOIP (Bring Your Own IP) prefix. This data source provides a list of all IP addresses
* that are currently assigned to resources from a specific BYOIP prefix.
*
* **Note:** This data source only lists IPs that are already assigned to resources (like Droplets).
* To allocate new IPs from the BYOIP prefix, you need to use `digitalocean.ReservedIpAssignment` resource.
*
* ## Example Usage
*
* List all assigned IP addresses from a BYOIP prefix:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as digitalocean from "@pulumi/digitalocean";
*
* const example = digitalocean.getByoipPrefix({
* uuid: "506f78a4-e098-11e5-ad9f-000f53306ae1",
* });
* const exampleGetByoipPrefixResources = example.then(example => digitalocean.getByoipPrefixResources({
* byoipPrefixUuid: example.uuid,
* }));
* export const assignedByoipIps = exampleGetByoipPrefixResources.then(exampleGetByoipPrefixResources => .map(addr => ({
* ip: addr.ipAddress,
* region: addr.region,
* assigned: addr.assignedAt,
* })));
* ```
*/
function getByoipPrefixResourcesOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("digitalocean:index/getByoipPrefixResources:getByoipPrefixResources", {
"byoipPrefixUuid": args.byoipPrefixUuid,
}, opts);
}
exports.getByoipPrefixResourcesOutput = getByoipPrefixResourcesOutput;
//# sourceMappingURL=getByoipPrefixResources.js.map