Cloud.ReservedIp
A Better Stack Cloud reserved IP: a public IPv4 or IPv6 address that belongs to the team rather than to a server (Hetzner’s floating/primary IP). Assign it to a server and move it to another one; it stays when the server is deleted. The server’s firewall filters it like its other public addresses, but outbound connections still leave from the server’s boot address.
Billing: an IPv4 address costs $3/month (IPv6 addresses are free, per
the pricing page), billed by its term (monthly, the default, or
annual) whether it is assigned or not, and it counts toward the public
IP quota. term changes in place and applies at once. Deleting it
releases the address for good: you can’t get it back.
name, ptrRecord (reverse DNS), term, metadata and serverId
change in place; removing name or ptrRecord from the config clears
it, removing metadata keeps the tags (set metadata: {} to clear
them). type, teamId and availabilityZone replace the reserved IP —
a new address. The name is unique in the organization, so a replacement
that keeps an explicit name deletes the old address first.
Before delete the address is unassigned from its server. While a server
that held it is still being deleted, the API refuses the delete with
ReservationInUse; the delete retries for up to 5 minutes until the
reservation clears.
Reserving an address
Section titled “Reserving an address”An IPv4 address, billed monthly
const ip = yield* BetterStack.Cloud.ReservedIp("ingress", { type: "ipv4",});Named, with reverse DNS and tags
yield* BetterStack.Cloud.ReservedIp("mail", { type: "ipv4", name: "mail", ptrRecord: "mail.example.com", metadata: { role: "mail" },});Assigning to a server
Section titled “Assigning to a server”Point the address at a server (move it by changing serverId)
yield* BetterStack.Cloud.ReservedIp("web-ip", { type: "ipv4", serverId: server.id,});Looking up an existing reserved IP
Section titled “Looking up an existing reserved IP”Reference an address by its IP
const existing = BetterStack.Cloud.ReservedIp.lookup({ ip: "203.0.113.7" });type "ipv4" | "ipv6" | string required
Whether it's an IPv4 or an IPv6 address. Can't be changed after the reserved IP is created.
availabilityZone string
Availability zone the resource lives in, such as us-west-2a. Defaults to the credentials' zone (BETTERSTACK_AVAILABILITY_ZONE, or the profile's). Changing it replaces the resource. A child of a resource in another zone (a firewall rule, a node pool, a snapshot of an instance outside the credentials' zone) must repeat the parent's availabilityZone: it receives only the parent's id, so its zone cannot be derived.
metadata CreateReservedIpRequestMetadataMap
Your own tags, as an object of string keys and values. An update replaces all tags, so an empty object removes them.
name string
The reserved IP's name, unique in the organization.
ptrRecord string
The reverse DNS name for the address. When you send a ptr_record as you assign the address, that one is used while the address stays assigned.
serverId string | null
The server to assign the address to (like Hetzner's floating IP assignment), or null to unassign it. Assigning and unassigning are their own API actions, run in place; the address moves between servers without being replaced. Leave it out to not manage the assignment here (e.g. when the server's own reservedIpIds assigns it): assign either here or on the server, not both.
teamId string
Team that owns the resource, such as t123. Defaults to the credentials' team (BETTERSTACK_TEAM_ID, or the profile's team). Changing it replaces the resource.
term "monthly" | "annual" | string
The billing term. Defaults to monthly. A change applies at once, from monthly to annual or back.
Attributes
Section titled “Attributes”availabilityZone string always set
Availability zone the resource lives in, such as us-west-2a.
id string always set
The reserved IP's ID, a UUID.
createdAt string
When the reserved IP was created.
gateway string | null
The gateway for the address, for when you configure the server's network yourself.
ip string
The IP address.
metadata ReservedIpMetadataMap
Your own tags, as an object of string keys and values. An update replaces all tags, so an empty object removes them.
name string | null
The reserved IP's name, unique in the organization.
ptrRecord string | null
The reverse DNS name for the address. When you send a ptr_record as you assign the address, that one is used while the address stays assigned.
server ReservedIpServer | null
The ID, name and status of the server the address is assigned to, or null when the address isn't assigned.
serverId string | null
The ID of the server the address is assigned to, or null when it isn't assigned. Assign and unassign the address to change it.
teamId string
The ID of the team that owns the reserved IP. betterstack team list shows it.
term "monthly" | "annual"
The billing term. Defaults to monthly. A change applies at once, from monthly to annual or back.
type "ipv4" | "ipv6"
Whether it's an IPv4 or an IPv6 address. Can't be changed after the reserved IP is created.
updatedAt string
When the reserved IP was last updated.
Lookup
Section titled “Lookup”ReservedIp.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.
availabilityZone string
Zone it lives in, such as us-west-2a. Defaults to the credentials' zone.
See also
Section titled “See also”- Ownership. Every object the stack creates carries an
alchemyentry in itsmetadata(<stack>/<stage>/<resource id>#<instance>), added on every write and left out of the attributes and of diffs; your own keys are untouched (it takes one of the 10 slots). A deploy that lost track of an object it created (a create that failed or was interrupted after the API accepted it) finds it by that marker and converges it instead of creating another;list(and soalchemy nuke) returns only Alchemy-created objects; an object that matches but carries no marker of this resource is taken over only with--adopt. - https://betterstack.com/docs/cloud/pricing/