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:
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,
})));
import pulumi
import pulumi_digitalocean as digitalocean
example = digitalocean.get_byoip_prefix(uuid="506f78a4-e098-11e5-ad9f-000f53306ae1")
example_get_byoip_prefix_resources = digitalocean.get_byoip_prefix_resources(byoip_prefix_uuid=example.uuid)
pulumi.export("assignedByoipIps", [{
"ip": addr.ip_address,
"region": addr.region,
"assigned": addr.assigned_at,
} for addr in example_get_byoip_prefix_resources.addresses])
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
var example = DigitalOcean.GetByoipPrefix.Invoke(new()
{
Uuid = "506f78a4-e098-11e5-ad9f-000f53306ae1",
});
var exampleGetByoipPrefixResources = DigitalOcean.GetByoipPrefixResources.Invoke(new()
{
ByoipPrefixUuid = example.Apply(getByoipPrefixResult => getByoipPrefixResult.Uuid),
});
return new Dictionary<string, object?>
{
["assignedByoipIps"] = .Select(addr =>
{
return
{
{ "ip", addr.IpAddress },
{ "region", addr.Region },
{ "assigned", addr.AssignedAt },
};
}).ToList(),
};
});
Example coming soon!
Example coming soon!
Using getByoipPrefixResources
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getByoipPrefixResources(args: GetByoipPrefixResourcesArgs, opts?: InvokeOptions): Promise<GetByoipPrefixResourcesResult>
function getByoipPrefixResourcesOutput(args: GetByoipPrefixResourcesOutputArgs, opts?: InvokeOptions): Output<GetByoipPrefixResourcesResult>def get_byoip_prefix_resources(byoip_prefix_uuid: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetByoipPrefixResourcesResult
def get_byoip_prefix_resources_output(byoip_prefix_uuid: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetByoipPrefixResourcesResult]func GetByoipPrefixResources(ctx *Context, args *GetByoipPrefixResourcesArgs, opts ...InvokeOption) (*GetByoipPrefixResourcesResult, error)
func GetByoipPrefixResourcesOutput(ctx *Context, args *GetByoipPrefixResourcesOutputArgs, opts ...InvokeOption) GetByoipPrefixResourcesResultOutput> Note: This function is named GetByoipPrefixResources in the Go SDK.
public static class GetByoipPrefixResources
{
public static Task<GetByoipPrefixResourcesResult> InvokeAsync(GetByoipPrefixResourcesArgs args, InvokeOptions? opts = null)
public static Output<GetByoipPrefixResourcesResult> Invoke(GetByoipPrefixResourcesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetByoipPrefixResourcesResult> getByoipPrefixResources(GetByoipPrefixResourcesArgs args, InvokeOptions options)
public static Output<GetByoipPrefixResourcesResult> getByoipPrefixResources(GetByoipPrefixResourcesArgs args, InvokeOptions options)
fn::invoke:
function: digitalocean:index/getByoipPrefixResources:getByoipPrefixResources
arguments:
# arguments dictionaryThe following arguments are supported:
- Byoip
Prefix stringUuid - The UUID of the BYOIP prefix to list addresses from.
- Byoip
Prefix stringUuid - The UUID of the BYOIP prefix to list addresses from.
- byoip
Prefix StringUuid - The UUID of the BYOIP prefix to list addresses from.
- byoip
Prefix stringUuid - The UUID of the BYOIP prefix to list addresses from.
- byoip_
prefix_ struuid - The UUID of the BYOIP prefix to list addresses from.
- byoip
Prefix StringUuid - The UUID of the BYOIP prefix to list addresses from.
getByoipPrefixResources Result
The following output properties are available:
- Addresses
List<Pulumi.
Digital Ocean. Outputs. Get Byoip Prefix Resources Address> - A list of IP addresses allocated from the BYOIP prefix. Each address has the following attributes:
- Byoip
Prefix stringUuid - Id string
- The provider-assigned unique ID for this managed resource.
- Addresses
[]Get
Byoip Prefix Resources Address - A list of IP addresses allocated from the BYOIP prefix. Each address has the following attributes:
- Byoip
Prefix stringUuid - Id string
- The provider-assigned unique ID for this managed resource.
- addresses
List<Get
Byoip Prefix Resources Address> - A list of IP addresses allocated from the BYOIP prefix. Each address has the following attributes:
- byoip
Prefix StringUuid - id String
- The provider-assigned unique ID for this managed resource.
- addresses
Get
Byoip Prefix Resources Address[] - A list of IP addresses allocated from the BYOIP prefix. Each address has the following attributes:
- byoip
Prefix stringUuid - id string
- The provider-assigned unique ID for this managed resource.
- addresses
Sequence[Get
Byoip Prefix Resources Address] - A list of IP addresses allocated from the BYOIP prefix. Each address has the following attributes:
- byoip_
prefix_ struuid - id str
- The provider-assigned unique ID for this managed resource.
- addresses List<Property Map>
- A list of IP addresses allocated from the BYOIP prefix. Each address has the following attributes:
- byoip
Prefix StringUuid - id String
- The provider-assigned unique ID for this managed resource.
Supporting Types
GetByoipPrefixResourcesAddress
- Assigned
At string - The timestamp when the IP was assigned.
- Id int
- The unique identifier of the IP address allocation.
- Ip
Address string - The IP address.
- Region string
- The region where the IP is allocated.
- Assigned
At string - The timestamp when the IP was assigned.
- Id int
- The unique identifier of the IP address allocation.
- Ip
Address string - The IP address.
- Region string
- The region where the IP is allocated.
- assigned
At String - The timestamp when the IP was assigned.
- id Integer
- The unique identifier of the IP address allocation.
- ip
Address String - The IP address.
- region String
- The region where the IP is allocated.
- assigned
At string - The timestamp when the IP was assigned.
- id number
- The unique identifier of the IP address allocation.
- ip
Address string - The IP address.
- region string
- The region where the IP is allocated.
- assigned_
at str - The timestamp when the IP was assigned.
- id int
- The unique identifier of the IP address allocation.
- ip_
address str - The IP address.
- region str
- The region where the IP is allocated.
- assigned
At String - The timestamp when the IP was assigned.
- id Number
- The unique identifier of the IP address allocation.
- ip
Address String - The IP address.
- region String
- The region where the IP is allocated.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.
