AccessInfrastructureTarget
Source:
src/Cloudflare/Access/InfrastructureTarget.ts
A Cloudflare Access Infrastructure Target — a server (hostname + IPv4/IPv6 address) protected by Access for Infrastructure (SSH).
Targets are referenced by infrastructure Access applications, which attach SSH access policies to them. Hostname and IP are both mutable in place; the target’s identity is its Cloudflare-assigned UUID.
Creating a Target
Section titled “Creating a Target”Basic IPv4 target
const target = yield* Cloudflare.AccessInfrastructureTarget("Bastion", { hostname: "bastion.internal", ip: { ipv4: { ipAddr: "10.0.0.5" } },});Target scoped to a virtual network
const vnet = yield* Cloudflare.TunnelVirtualNetwork("Staging", {});const target = yield* Cloudflare.AccessInfrastructureTarget("DbHost", { hostname: "db.staging.internal", ip: { ipv4: { ipAddr: "10.4.0.10", virtualNetworkId: vnet.virtualNetworkId, }, },});Updating
Section titled “Updating”// Hostname and IP update in place — same targetId, no replacement.const target = yield* Cloudflare.AccessInfrastructureTarget("Bastion", { hostname: "bastion.internal", ip: { ipv4: { ipAddr: "10.0.0.6" } },});