1. Packages
  2. DigitalOcean Provider
  3. API Docs
  4. getByoipPrefix
DigitalOcean v4.56.0 published on Monday, Dec 22, 2025 by Pulumi
digitalocean logo
DigitalOcean v4.56.0 published on Monday, Dec 22, 2025 by Pulumi

    Example Usage

    Get the BYOIP prefix:

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const example = digitalocean.getByoipPrefix({
        uuid: "506f78a4-e098-11e5-ad9f-000f53306ae1",
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    example = digitalocean.get_byoip_prefix(uuid="506f78a4-e098-11e5-ad9f-000f53306ae1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := digitalocean.LookupByoipPrefix(ctx, &digitalocean.LookupByoipPrefixArgs{
    			Uuid: "506f78a4-e098-11e5-ad9f-000f53306ae1",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.DigitaloceanFunctions;
    import com.pulumi.digitalocean.inputs.GetByoipPrefixArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = DigitaloceanFunctions.getByoipPrefix(GetByoipPrefixArgs.builder()
                .uuid("506f78a4-e098-11e5-ad9f-000f53306ae1")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: digitalocean:getByoipPrefix
          arguments:
            uuid: 506f78a4-e098-11e5-ad9f-000f53306ae1
    

    List 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 byoipInfo = {
        prefix: example.then(example => example.prefix),
        region: example.then(example => example.region),
        status: example.then(example => example.status),
        assignedCount: exampleGetByoipPrefixResources.then(exampleGetByoipPrefixResources => exampleGetByoipPrefixResources.addresses).length,
    };
    
    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("byoipInfo", {
        "prefix": example.prefix,
        "region": example.region,
        "status": example.status,
        "assignedCount": len(example_get_byoip_prefix_resources.addresses),
    })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := digitalocean.LookupByoipPrefix(ctx, &digitalocean.LookupByoipPrefixArgs{
    			Uuid: "506f78a4-e098-11e5-ad9f-000f53306ae1",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleGetByoipPrefixResources, err := digitalocean.GetByoipPrefixResources(ctx, &digitalocean.GetByoipPrefixResourcesArgs{
    			ByoipPrefixUuid: example.Uuid,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("byoipInfo", pulumi.Map{
    			"prefix":        example.Prefix,
    			"region":        example.Region,
    			"status":        example.Status,
    			"assignedCount": len(exampleGetByoipPrefixResources.Addresses),
    		})
    		return nil
    	})
    }
    
    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?>
        {
            ["byoipInfo"] = 
            {
                { "prefix", example.Apply(getByoipPrefixResult => getByoipPrefixResult.Prefix) },
                { "region", example.Apply(getByoipPrefixResult => getByoipPrefixResult.Region) },
                { "status", example.Apply(getByoipPrefixResult => getByoipPrefixResult.Status) },
                { "assignedCount", exampleGetByoipPrefixResources.Apply(getByoipPrefixResourcesResult => getByoipPrefixResourcesResult.Addresses).Length },
            },
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.DigitaloceanFunctions;
    import com.pulumi.digitalocean.inputs.GetByoipPrefixArgs;
    import com.pulumi.digitalocean.inputs.GetByoipPrefixResourcesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var example = DigitaloceanFunctions.getByoipPrefix(GetByoipPrefixArgs.builder()
                .uuid("506f78a4-e098-11e5-ad9f-000f53306ae1")
                .build());
    
            final var exampleGetByoipPrefixResources = DigitaloceanFunctions.getByoipPrefixResources(GetByoipPrefixResourcesArgs.builder()
                .byoipPrefixUuid(example.uuid())
                .build());
    
            ctx.export("byoipInfo", Map.ofEntries(
                Map.entry("prefix", example.prefix()),
                Map.entry("region", example.region()),
                Map.entry("status", example.status()),
                Map.entry("assignedCount", exampleGetByoipPrefixResources.addresses().length())
            ));
        }
    }
    
    Example coming soon!
    

    Using getByoipPrefix

    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 getByoipPrefix(args: GetByoipPrefixArgs, opts?: InvokeOptions): Promise<GetByoipPrefixResult>
    function getByoipPrefixOutput(args: GetByoipPrefixOutputArgs, opts?: InvokeOptions): Output<GetByoipPrefixResult>
    def get_byoip_prefix(uuid: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetByoipPrefixResult
    def get_byoip_prefix_output(uuid: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetByoipPrefixResult]
    func LookupByoipPrefix(ctx *Context, args *LookupByoipPrefixArgs, opts ...InvokeOption) (*LookupByoipPrefixResult, error)
    func LookupByoipPrefixOutput(ctx *Context, args *LookupByoipPrefixOutputArgs, opts ...InvokeOption) LookupByoipPrefixResultOutput

    > Note: This function is named LookupByoipPrefix in the Go SDK.

    public static class GetByoipPrefix 
    {
        public static Task<GetByoipPrefixResult> InvokeAsync(GetByoipPrefixArgs args, InvokeOptions? opts = null)
        public static Output<GetByoipPrefixResult> Invoke(GetByoipPrefixInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetByoipPrefixResult> getByoipPrefix(GetByoipPrefixArgs args, InvokeOptions options)
    public static Output<GetByoipPrefixResult> getByoipPrefix(GetByoipPrefixArgs args, InvokeOptions options)
    
    fn::invoke:
      function: digitalocean:index/getByoipPrefix:getByoipPrefix
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Uuid string
    The UUID of the BYOIP prefix.
    Uuid string
    The UUID of the BYOIP prefix.
    uuid String
    The UUID of the BYOIP prefix.
    uuid string
    The UUID of the BYOIP prefix.
    uuid str
    The UUID of the BYOIP prefix.
    uuid String
    The UUID of the BYOIP prefix.

    getByoipPrefix Result

    The following output properties are available:

    Advertised bool
    A boolean indicating whether the prefix is currently being advertised.
    FailureReason string
    The reason for failure if the status is "failed".
    Id string
    The provider-assigned unique ID for this managed resource.
    Prefix string
    The CIDR notation of the prefix (e.g., "192.0.2.0/24").
    Region string
    The DigitalOcean region where the prefix is deployed.
    Status string
    The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
    Uuid string
    The UUID of the BYOIP prefix.
    Advertised bool
    A boolean indicating whether the prefix is currently being advertised.
    FailureReason string
    The reason for failure if the status is "failed".
    Id string
    The provider-assigned unique ID for this managed resource.
    Prefix string
    The CIDR notation of the prefix (e.g., "192.0.2.0/24").
    Region string
    The DigitalOcean region where the prefix is deployed.
    Status string
    The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
    Uuid string
    The UUID of the BYOIP prefix.
    advertised Boolean
    A boolean indicating whether the prefix is currently being advertised.
    failureReason String
    The reason for failure if the status is "failed".
    id String
    The provider-assigned unique ID for this managed resource.
    prefix String
    The CIDR notation of the prefix (e.g., "192.0.2.0/24").
    region String
    The DigitalOcean region where the prefix is deployed.
    status String
    The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
    uuid String
    The UUID of the BYOIP prefix.
    advertised boolean
    A boolean indicating whether the prefix is currently being advertised.
    failureReason string
    The reason for failure if the status is "failed".
    id string
    The provider-assigned unique ID for this managed resource.
    prefix string
    The CIDR notation of the prefix (e.g., "192.0.2.0/24").
    region string
    The DigitalOcean region where the prefix is deployed.
    status string
    The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
    uuid string
    The UUID of the BYOIP prefix.
    advertised bool
    A boolean indicating whether the prefix is currently being advertised.
    failure_reason str
    The reason for failure if the status is "failed".
    id str
    The provider-assigned unique ID for this managed resource.
    prefix str
    The CIDR notation of the prefix (e.g., "192.0.2.0/24").
    region str
    The DigitalOcean region where the prefix is deployed.
    status str
    The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
    uuid str
    The UUID of the BYOIP prefix.
    advertised Boolean
    A boolean indicating whether the prefix is currently being advertised.
    failureReason String
    The reason for failure if the status is "failed".
    id String
    The provider-assigned unique ID for this managed resource.
    prefix String
    The CIDR notation of the prefix (e.g., "192.0.2.0/24").
    region String
    The DigitalOcean region where the prefix is deployed.
    status String
    The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
    uuid String
    The UUID of the BYOIP prefix.

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.56.0 published on Monday, Dec 22, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate