VPC 환경에서 이용 가능합니다.
타깃 그룹을 생성합니다.
구문
createTargetGroup 구문은 다음과 같습니다.
./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|KRS>] \
[--output <json|xml>]
옵션
createTargetGroup 실행 시 지정할 수 있는 옵션을 설명합니다.
필수 옵션
createTargetGroup의 필수 옵션입니다.
| 옵션 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
--vpcNo |
String | Required | VPC 번호
|
--targetGroupProtocolTypeCode |
String | Required | 타깃 그룹의 프로토콜 유형
|
--healthCheckProtocolTypeCode |
String | Required | 타깃의 상태를 확인하기 위한 헬스 체크 수행 시 로드밸런서가 사용하는 프로토콜
|
--healthCheckHttpMethodTypeCode |
String | Conditional | 헬스 체크 수행 시 사용할 HTTP 메서드 유형
|
선택 옵션
createTargetGroup의 선택 옵션입니다. 지정하지 않은 옵션에는 기본값이 적용됩니다.
| 옵션 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
--targetGroupName |
String | Optional | 타깃 그룹의 이름
|
--targetTypeCode |
String | Optional | 타깃 그룹에 추가될 타깃 유형
|
--targetGroupPort |
Integer | Optional | 타깃 그룹에서 사용하는 포트
|
--targetGroupDescription |
String | Optional | 타깃 그룹에 대한 설명 (Byte)
|
--healthCheckPort |
Integer | Optional | 타깃의 상태를 확인하기 위한 헬스 체크 수행 시 로드밸런서가 사용하는 포트
|
--healthCheckUrlPath |
String | Optional | 헬스 체크 수행 시 사용할 URL 경로
|
--healthCheckCycle |
Integer | Optional | 헬스 체크 주기 (초)
|
--healthCheckUpThreshold |
Integer | Optional | 타깃 상태를 정상이라고 판단하기 위해 필요한 연속적인 헬스 체크 성공 횟수
|
--healthCheckDownThreshold |
Integer | Optional | 타깃 상태를 비정상이라고 판단하기 위해 필요한 연속적인 헬스 체크 실패 횟수
|
--targetNoList |
List | Optional | 타깃 그룹에 바인딩할 타깃 목록
|
공통 옵션
vloadbalancer 명령에서 공통으로 사용하는 옵션에 대한 정보는 Load Balancer (VPC) 옵션을 참조해 주십시오.
예시
타깃 그룹 생성 요청이 성공하면 타깃 그룹의 구성 정보가 반환됩니다.
명령
명령 예시는 다음과 같습니다.
./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
출력
출력 예시는 다음과 같습니다.
{
"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-20T17:28:30+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": "46d2799b-8540-4894-bc71-5481bcea7126",
"returnCode": "0",
"returnMessage": "success"
}
}