Available in VPC
Create a target group.
Syntax
The createTargetGroup syntax is as follows:
./ncloud vloadbalancer createTargetGroup \
--vpcNo <vpc-no> \
--targetGroupProtocolTypeCode <TCP|UDP|PROXY_TCP|HTTP|HTTPS> \
--healthCheckProtocolTypeCode <TCP|HTTP|HTTPS> \
[--targetGroupName <target-group-name>] \
[--targetTypeCode <VSVR>] \
[--targetGroupPort <target-group-port>] \
[--targetGroupDescription <target-group-description>] \
[--healthCheckPort <health-check-port>] \
[--healthCheckUrlPath <health-check-url-path>] \
[--healthCheckHttpMethodTypeCode <HEAD|GET>] \
[--healthCheckCycle <health-check-cycle>] \
[--healthCheckUpThreshold <health-check-up-threshold>] \
[--healthCheckDownThreshold <health-check-down-threshold>] \
[--targetNoList <target-no-list>] \
[--regionCode <KR|SGN|JPN>] \
[--output <json|xml>]
Options
This section describes the options available when running createTargetGroup.
Required options
The following options are required for createTargetGroup.
| Options | Type | Required | Description |
|---|---|---|---|
--vpcNo |
String | Required | VPC number
|
--targetGroupProtocolTypeCode |
String | Required | Target group protocol type
|
--healthCheckProtocolTypeCode |
String | Required | Protocol used by the load balancer when performing health checks to verify the status of targets
|
--healthCheckHttpMethodTypeCode |
String | Conditional | HTTP method type to use when performing health checks
|
Optional options
These are the optional options for createTargetGroup. Options that are not specified will use their default values.
| Options | Type | Required | Description |
|---|---|---|---|
--targetGroupName |
String | Optional | Target group name
|
--targetTypeCode |
String | Optional | Target type to be added to the target group
|
--targetGroupPort |
Integer | Optional | Port used by the target group
|
--targetGroupDescription |
String | Optional | Description of the target group (byte)
|
--healthCheckPort |
Integer | Optional | Port used by the load balancer to perform health checks on the target
|
--healthCheckUrlPath |
String | Optional | URL path to use for health checks
|
--healthCheckCycle |
Integer | Optional | Health check interval (second)
|
--healthCheckUpThreshold |
Integer | Optional | Number of consecutive successful health checks required to determine that the target is in a normal state
|
--healthCheckDownThreshold |
Integer | Optional | Number of consecutive health check failures required to determine that the target status is abnormal
|
--targetNoList |
List | Optional | List of targets to bind to the target group
|
Common options
For information about the options common to all vloadbalancer subcommands, see Load Balancer (VPC) options.
Examples
If the request to create a target group is successful, the target group's configuration information is returned.
Command
The command example is as follows:
./ncloud vloadbalancer createTargetGroup \
--vpcNo 12345678 \
--targetGroupProtocolTypeCode HTTP \
--healthCheckProtocolTypeCode HTTP \
--targetGroupName lb-test-tg \
--targetGroupPort 80 \
--targetGroupDescription "Test target group" \
--healthCheckHttpMethodTypeCode GET \
--regionCode KR \
--output json
Output
The output example is as follows:
{
"createTargetGroupResponse": {
"totalRows": 1,
"targetGroupList": [
{
"targetGroupNo": "55667788",
"targetGroupName": "lb-test-tg",
"targetType": {
"code": "VSVR",
"codeName": "Server (VPC)"
},
"vpcNo": "12345678",
"targetGroupProtocolType": {
"code": "HTTP",
"codeName": "HTTP protocol"
},
"targetGroupPort": 80,
"targetGroupDescription": "Test target group",
"useStickySession": false,
"useProxyProtocol": false,
"algorithmType": {
"code": "RR",
"codeName": "Round Robin"
},
"createDate": "2026-07-07T17:08:44+0900",
"regionCode": "KR",
"loadBalancerInstanceNo": "",
"healthCheckProtocolType": {
"code": "HTTP",
"codeName": "HTTP protocol"
},
"healthCheckPort": 80,
"healthCheckUrlPath": "/",
"healthCheckHttpMethodType": {
"code": "GET",
"codeName": "HTTP GET Method"
},
"healthCheckCycle": 30,
"healthCheckUpThreshold": 2,
"healthCheckDownThreshold": 2,
"targetNoList": []
}
],
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"returnCode": "0",
"returnMessage": "success"
}
}