Skip to main content
POST
Create a target group
Requires the IAM action loadbalancer:CreateTargetGroup. See LOADBALANCER permissions for the full list, what each one covers, and an example policy.

Authorizations

Authorization
string
header
required

An OAuth 2.0 bearer token, sent as Authorization: Bearer <token>. This is the recommended way to authenticate.

Get one by exchanging a service account's access key pair at POST /v1/oauth/token with grant_type=client_credentials. It is the standard client-credentials grant, so any OAuth-aware library will obtain and refresh it for you.

Tokens last an hour by default. The same access key pair is separately your AWS SigV4 credential for the S3-compatible object endpoint, which speaks nothing else.

Headers

Idempotency-Key
string

Optional client-generated key that makes a create replay-safe. Retrying a request with the same key returns the original outcome verbatim instead of creating a duplicate resource. Reusing a key with a different request body is rejected (422); a request whose key is still being processed returns 409. Records are honored for 24 hours. Use a UUID or similarly unique token.

Maximum string length: 255

Body

application/json

instance_pool accepts a UUID, CRN or exact account-scoped name in this region and requires pool target mode.

name
string
required

Resource names must not start with the literal crn: prefix or be UUIDs (canonical, compact, braced, or urn:uuid: forms, in either case).

Example:

"web-targets"

protocol
enum<string>
required
Available options:
http,
https,
tcp,
udp
Example:

"http"

port
integer
required
Required range: 1 <= x <= 65535
Example:

8080

target_type
enum<string>
default:ip
Available options:
ip,
instance,
function
Example:

"instance"

health_check
object

Active probes are enabled by default. Set enabled=false to stop probes while retaining their configuration. An explicitly enabled HTTP/HTTPS check requires a non-empty path starting with /. TCP checks connect to the check port without an HTTP path. UDP groups default to TCP connect probes.

proxy_protocol
boolean
default:false
Example:

false

session_affinity
object

Sticky sessions: pin a client to one backend in the group instead of balancing each request independently. Off unless you ask for it.

The data plane hashes the key consistently, so adding or losing a backend only moves the clients that backend was serving.

target_mode
enum<string>
default:static

static (the default) takes the backends you attach as targets. pool takes them from a compute instance pool and requires instance_pool; the group is forced to target_type=instance, and attaching targets to it is rejected.

Available options:
static,
pool
Example:

"static"

instance_pool
string

Compute instance pool to draw backends from. Required when target_mode=pool and must belong to the calling account; ignored otherwise.

Example:

"a1b2c3d4-e5f6-4789-a0b1-c2d3e4f5a6b7"

tags
object
Example:

Response

Created

target_group
object
required