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
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 pulumi
import pulumi_digitalocean as digitalocean
# Create a new BYOIP prefix
example = digitalocean.ByoipPrefix("example",
prefix="192.0.2.0/24",
signature=prefix_signature,
region="nyc3",
advertised=False)
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 {
// Create a new BYOIP prefix
_, err := digitalocean.NewByoipPrefix(ctx, "example", &digitalocean.ByoipPrefixArgs{
Prefix: pulumi.String("192.0.2.0/24"),
Signature: pulumi.Any(prefixSignature),
Region: pulumi.String("nyc3"),
Advertised: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
return await Deployment.RunAsync(() =>
{
// Create a new BYOIP prefix
var example = new DigitalOcean.ByoipPrefix("example", new()
{
Prefix = "192.0.2.0/24",
Signature = prefixSignature,
Region = "nyc3",
Advertised = false,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.ByoipPrefix;
import com.pulumi.digitalocean.ByoipPrefixArgs;
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) {
// Create a new BYOIP prefix
var example = new ByoipPrefix("example", ByoipPrefixArgs.builder()
.prefix("192.0.2.0/24")
.signature(prefixSignature)
.region("nyc3")
.advertised(false)
.build());
}
}
resources:
# Create a new BYOIP prefix
example:
type: digitalocean:ByoipPrefix
properties:
prefix: 192.0.2.0/24
signature: ${prefixSignature}
region: nyc3
advertised: false
Create ByoipPrefix Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ByoipPrefix(name: string, args: ByoipPrefixArgs, opts?: CustomResourceOptions);@overload
def ByoipPrefix(resource_name: str,
args: ByoipPrefixArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ByoipPrefix(resource_name: str,
opts: Optional[ResourceOptions] = None,
prefix: Optional[str] = None,
region: Optional[str] = None,
advertised: Optional[bool] = None,
signature: Optional[str] = None)func NewByoipPrefix(ctx *Context, name string, args ByoipPrefixArgs, opts ...ResourceOption) (*ByoipPrefix, error)public ByoipPrefix(string name, ByoipPrefixArgs args, CustomResourceOptions? opts = null)
public ByoipPrefix(String name, ByoipPrefixArgs args)
public ByoipPrefix(String name, ByoipPrefixArgs args, CustomResourceOptions options)
type: digitalocean:ByoipPrefix
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ByoipPrefixArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ByoipPrefixArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ByoipPrefixArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ByoipPrefixArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ByoipPrefixArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var byoipPrefixResource = new DigitalOcean.ByoipPrefix("byoipPrefixResource", new()
{
Prefix = "string",
Region = "string",
Advertised = false,
Signature = "string",
});
example, err := digitalocean.NewByoipPrefix(ctx, "byoipPrefixResource", &digitalocean.ByoipPrefixArgs{
Prefix: pulumi.String("string"),
Region: pulumi.String("string"),
Advertised: pulumi.Bool(false),
Signature: pulumi.String("string"),
})
var byoipPrefixResource = new ByoipPrefix("byoipPrefixResource", ByoipPrefixArgs.builder()
.prefix("string")
.region("string")
.advertised(false)
.signature("string")
.build());
byoip_prefix_resource = digitalocean.ByoipPrefix("byoipPrefixResource",
prefix="string",
region="string",
advertised=False,
signature="string")
const byoipPrefixResource = new digitalocean.ByoipPrefix("byoipPrefixResource", {
prefix: "string",
region: "string",
advertised: false,
signature: "string",
});
type: digitalocean:ByoipPrefix
properties:
advertised: false
prefix: string
region: string
signature: string
ByoipPrefix Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ByoipPrefix resource accepts the following input properties:
- Prefix string
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- Region string
- The DigitalOcean region where the prefix will be deployed.
- Advertised bool
- A boolean indicating whether the prefix should be advertised.
Defaults to
false. - Signature string
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- Prefix string
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- Region string
- The DigitalOcean region where the prefix will be deployed.
- Advertised bool
- A boolean indicating whether the prefix should be advertised.
Defaults to
false. - Signature string
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- prefix String
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- region String
- The DigitalOcean region where the prefix will be deployed.
- advertised Boolean
- A boolean indicating whether the prefix should be advertised.
Defaults to
false. - signature String
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- prefix string
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- region string
- The DigitalOcean region where the prefix will be deployed.
- advertised boolean
- A boolean indicating whether the prefix should be advertised.
Defaults to
false. - signature string
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- prefix str
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- region str
- The DigitalOcean region where the prefix will be deployed.
- advertised bool
- A boolean indicating whether the prefix should be advertised.
Defaults to
false. - signature str
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- prefix String
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- region String
- The DigitalOcean region where the prefix will be deployed.
- advertised Boolean
- A boolean indicating whether the prefix should be advertised.
Defaults to
false. - signature String
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
Outputs
All input properties are implicitly available as output properties. Additionally, the ByoipPrefix resource produces the following output properties:
- Failure
Reason string - The reason for failure if the status is "failed".
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
- Uuid string
- The UUID of the BYOIP prefix.
- Failure
Reason string - The reason for failure if the status is "failed".
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
- Uuid string
- The UUID of the BYOIP prefix.
- failure
Reason String - The reason for failure if the status is "failed".
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
- uuid String
- The UUID of the BYOIP prefix.
- failure
Reason string - The reason for failure if the status is "failed".
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
- uuid string
- The UUID of the BYOIP prefix.
- failure_
reason str - The reason for failure if the status is "failed".
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
- uuid str
- The UUID of the BYOIP prefix.
- failure
Reason String - The reason for failure if the status is "failed".
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
- uuid String
- The UUID of the BYOIP prefix.
Look up Existing ByoipPrefix Resource
Get an existing ByoipPrefix resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ByoipPrefixState, opts?: CustomResourceOptions): ByoipPrefix@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
advertised: Optional[bool] = None,
failure_reason: Optional[str] = None,
prefix: Optional[str] = None,
region: Optional[str] = None,
signature: Optional[str] = None,
status: Optional[str] = None,
uuid: Optional[str] = None) -> ByoipPrefixfunc GetByoipPrefix(ctx *Context, name string, id IDInput, state *ByoipPrefixState, opts ...ResourceOption) (*ByoipPrefix, error)public static ByoipPrefix Get(string name, Input<string> id, ByoipPrefixState? state, CustomResourceOptions? opts = null)public static ByoipPrefix get(String name, Output<String> id, ByoipPrefixState state, CustomResourceOptions options)resources: _: type: digitalocean:ByoipPrefix get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Advertised bool
- A boolean indicating whether the prefix should be advertised.
Defaults to
false. - Failure
Reason string - The reason for failure if the status is "failed".
- Prefix string
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- Region string
- The DigitalOcean region where the prefix will be deployed.
- Signature string
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- 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 should be advertised.
Defaults to
false. - Failure
Reason string - The reason for failure if the status is "failed".
- Prefix string
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- Region string
- The DigitalOcean region where the prefix will be deployed.
- Signature string
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- 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 should be advertised.
Defaults to
false. - failure
Reason String - The reason for failure if the status is "failed".
- prefix String
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- region String
- The DigitalOcean region where the prefix will be deployed.
- signature String
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- 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 should be advertised.
Defaults to
false. - failure
Reason string - The reason for failure if the status is "failed".
- prefix string
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- region string
- The DigitalOcean region where the prefix will be deployed.
- signature string
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- 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 should be advertised.
Defaults to
false. - failure_
reason str - The reason for failure if the status is "failed".
- prefix str
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- region str
- The DigitalOcean region where the prefix will be deployed.
- signature str
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- 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 should be advertised.
Defaults to
false. - failure
Reason String - The reason for failure if the status is "failed".
- prefix String
- The CIDR notation of the prefix (e.g., "192.0.2.0/24").
- region String
- The DigitalOcean region where the prefix will be deployed.
- signature String
- The cryptographic signature proving ownership of the prefix. This is required during creation but can be omitted in subsequent updates.
- status String
- The current status of the BYOIP prefix (e.g., "verified", "pending", "failed").
- uuid String
- The UUID of the BYOIP prefix.
Import
BYOIP prefixes can be imported using the prefix uuid, e.g.
$ pulumi import digitalocean:index/byoipPrefix:ByoipPrefix example 506f78a4-e098-11e5-ad9f-000f53306ae1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.
