Skip to content
betterstack-alchemyUnofficial

Cloud.ServerPrivateIp

Kind ResourceType id BetterStack.Cloud.ServerPrivateIpSource src/Cloud/ServerPrivateIp.tsLive test gated Lifecycle test runs against the offline mock; a live run exists but is gated behind BETTERSTACK_TEST_CLOUD_SERVER=1 because it runs live only in the shared server suite (test/Cloud/live), one billed server per run (test/Cloud/ServerPrivateIp.test.ts).

A fixed private IP of a server in one of its private networks. The server must already be attached to the network (networkIds on the Cloud.Server); leave ipAddress out to get the next free address. There is no update: changing anything replaces the address. It goes away with its server.

Ownership. The API keeps no metadata for it and it has no generated name, so nothing marks it as this stack’s: list enumerates it under every parent, and a create interrupted before its state was saved is not recognised by the next deploy (which creates it again, or gets the API’s conflict when its identity is unique).

A replacement that keeps a fixed ipAddress (moving it to another server on the same network) deletes the old address first: the address is unique in its network (IpAlreadyAssigned).

Verified live (2026-12-01): a fixed address created on a server and configured on its interface (ip addr). NOT live-verified: replacement, a generated address.

10.0.0.5 in the server’s network

const ip = yield* BetterStack.Cloud.ServerPrivateIp("web-ip", {
serverId: server.id,
networkId: network.id,
ipAddress: "10.0.0.5",
});

networkId string required

The ID of the private network the address is in. The server must already be attached to the network.

serverId string required

The ID of the server that has the address.

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.

ipAddress string

The private IP address. Must be inside the network's CIDR. Leave it out to get the next free address.

availabilityZone string always set

Availability zone the resource lives in, such as us-west-2a.

id string always set

The address's ID on the server.

serverId string always set

The ID of the server that has the address.

createdAt string

When the address was assigned.

ipAddress string

The private IP address. Must be inside the network's CIDR. Leave it out to get the next free address.

networkId string

The ID of the private network the address is in. The server must already be attached to the network.

updatedAt string

When the private IP was last updated.

ServerPrivateIp.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.

id string required

The address's ID.

serverId string required

The server's ID.

availabilityZone string

Zone, such as us-west-2a. Defaults to the credentials' zone.