Available in VPC
Create a Cloud DB for PostgreSQL instance.
Syntax
The createCloudPostgresqlInstance syntax is as follows:
./ncloud vpostgresql createCloudPostgresqlInstance \
--vpcNo <vpc-no> \
--subnetNo <subnet-no> \
--cloudPostgresqlServiceName <service-name> \
--cloudPostgresqlServerNamePrefix <server-name-prefix> \
--cloudPostgresqlDatabaseName <database-name> \
--cloudPostgresqlUserName <user-name> \
--cloudPostgresqlUserPassword <user-password> \
--clientCidr <client-cidr> \
[--cloudPostgresqlImageProductCode <image-product-code>] \
[--cloudPostgresqlProductCode <product-code>] \
[--engineVersionCode <engine-version-code>] \
[--dataStorageTypeCode <SSD|HDD|CB2>] \
[--isStorageEncryption <true|false>] \
[--isHa <true|false>] \
[--isMultiZone <true|false>] \
[--secondarySubnetNo <secondary-subnet-no>] \
[--isBackup <true|false>] \
[--isAutomaticBackup <true|false>] \
[--backupTime <hh:mm>] \
[--backupFileRetentionPeriod <retention-days>] \
[--backupFileStorageCount <storage-count>] \
[--isBackupFileCompression <true|false>] \
[--cloudPostgresqlPort <port>] \
[--regionCode <KR|SGN|JPN>] \
[--output <json|xml>]
Options
This section describes the options available when running createCloudPostgresqlInstance.
Required options
The following options are required for createCloudPostgresqlInstance.
| Options | Type | Required | Description |
|---|---|---|---|
--vpcNo |
String | Required | Number of VPC to create the Cloud DB for PostgreSQL instance in |
--subnetNo |
String | Required | Subnet number of the default network interface to be used in the Cloud DB for PostgreSQL instance
|
--cloudPostgresqlServiceName |
String | Required | Cloud DB for PostgreSQL service name
|
--cloudPostgresqlServerNamePrefix |
String | Required | Prefix for the Cloud DB for PostgreSQL server name
|
--cloudPostgresqlDatabaseName |
String | Required | DB name to be created by default in the Cloud DB for PostgreSQL instance
|
--cloudPostgresqlUserName |
String | Required | DB user ID
|
--cloudPostgresqlUserPassword |
String | Required | DB user account password
|
--clientCidr |
String | Required | CIDR range of clients allowed to connect to the PostgreSQL server
|
--isMultiZone |
Boolean | Conditional | Multi-zone status
|
--secondarySubnetNo |
String | Conditional | Subnet number of the secondary server
|
--backupTime |
String | Conditional | Set backup time (HH:MM).
|
Optional options
These are the optional options for createCloudPostgresqlInstance. Options that are not specified will use their default values.
| Options | Type | Required | Description |
|---|---|---|---|
--cloudPostgresqlImageProductCode |
String | Optional | Cloud DB for PostgreSQL image product code
|
--cloudPostgresqlProductCode |
String | Optional | Cloud DB for PostgreSQL product code
|
--engineVersionCode |
String | Optional | DB engine version
|
--dataStorageTypeCode |
String | Optional | Data storage type code
|
--isStorageEncryption |
Boolean | Optional | Data storage encryption application status (to be applied later)
|
--isHa |
Boolean | Optional | High availability status
|
--isBackup |
Boolean | Optional | Whether PostgreSQL backup is enabled
|
--isAutomaticBackup |
Boolean | Optional | Whether to set the backup time automatically
|
--backupFileRetentionPeriod |
Integer | Optional | Backup file retention period (days)
|
--backupFileStorageCount |
Integer | Optional | Number of backup files to retain
|
--isBackupFileCompression |
Boolean | Optional | Whether to compress backup files
|
--cloudPostgresqlPort |
Integer | Optional | TCP port number to access the Cloud DB for PostgreSQL instance
|
Common options
For information about the options common to all vpostgresql subcommands, see Cloud DB for PostgreSQL (VPC) options.
Examples
If the request to create a Cloud DB for PostgreSQL instance is successful, the instance's configuration information and creation status are returned.
Command
The command example is as follows:
./ncloud vpostgresql createCloudPostgresqlInstance \
--vpcNo 12345678 \
--subnetNo 23456789 \
--cloudPostgresqlServiceName test-pgsql \
--cloudPostgresqlServerNamePrefix testpg \
--cloudPostgresqlDatabaseName testdb \
--cloudPostgresqlUserName testuser \
--cloudPostgresqlUserPassword Examplepw123! \
--clientCidr 0.0.0.0/0 \
--cloudPostgresqlImageProductCode SW.VPGSL.OS.LNX64.ROCKY.0810.PGSQL.B050 \
--cloudPostgresqlProductCode SVR.VPGSL.DBSVR.HICPU.C002.M004.NET.SSD.B050.G002 \
--dataStorageTypeCode SSD \
--isHa true \
--cloudPostgresqlPort 13432 \
--regionCode KR \
--output json
Output
The output example is as follows:
{
"createCloudPostgresqlInstanceResponse": {
"totalRows": 1,
"cloudPostgresqlInstanceList": [
{
"cloudPostgresqlInstanceNo": "34567890",
"cloudPostgresqlServiceName": "test-pgsql",
"cloudPostgresqlInstanceStatusName": "creating",
"cloudPostgresqlInstanceStatus": {
"code": "INIT",
"codeName": "CLOUD DATABASE (VPC) Init status"
},
"cloudPostgresqlInstanceOperation": {
"code": "CREAT",
"codeName": "CLOUD DATABASE(VPC) Creat OP"
},
"cloudPostgresqlImageProductCode": "SW.VPGSL.OS.LNX64.ROCKY.0810.PGSQL.B050",
"generationCode": "G2",
"engineVersion": "PostgreSQL 15.15",
"license": "PostgreSQL License",
"cloudPostgresqlPort": 13432,
"isHa": true,
"isMultiZone": false,
"isBackup": true,
"backupFileRetentionPeriod": 1,
"backupTime": "AUTO",
"createDate": "2026-06-09T18:40:14+0900",
"accessControlGroupNoList": [],
"cloudPostgresqlServerInstanceList": [
{
"cloudPostgresqlServerName": "testpg-001-98b4",
"cloudPostgresqlServerRole": {
"code": "M",
"codeName": "Primary"
},
"cloudPostgresqlServerInstanceStatusName": "creating",
"cloudPostgresqlServerInstanceStatus": {
"code": "PEND",
"codeName": "CLOUD DATABASE (VPC) server Pending status"
},
"cloudPostgresqlServerInstanceOperation": {
"code": "CREAT",
"codeName": "CLOUD DATABASE (VPC) server Create OP"
},
"cloudPostgresqlProductCode": "SVR.VPGSL.DBSVR.HICPU.C002.M004.NET.SSD.B050.G002",
"regionCode": "KR",
"zoneCode": "KR-1",
"vpcNo": "12345678",
"subnetNo": "23456789",
"isPublicSubnet": false,
"dataStorageType": {
"code": "SSD",
"codeName": "SSD"
},
"isStorageEncryption": false,
"dataStorageSize": 10737418240,
"cpuCount": 2,
"memorySize": 4294967296,
"createDate": "2026-06-09T18:40:14+0900"
},
{
"cloudPostgresqlServerName": "testpg-002-98b5",
"cloudPostgresqlServerRole": {
"code": "H",
"codeName": "Secondary"
},
"cloudPostgresqlServerInstanceStatusName": "creating",
"cloudPostgresqlServerInstanceStatus": {
"code": "PEND",
"codeName": "CLOUD DATABASE (VPC) server Pending status"
},
"cloudPostgresqlServerInstanceOperation": {
"code": "CREAT",
"codeName": "CLOUD DATABASE (VPC) server Create OP"
},
"cloudPostgresqlProductCode": "SVR.VPGSL.DBSVR.HICPU.C002.M004.NET.SSD.B050.G002",
"regionCode": "KR",
"zoneCode": "KR-1",
"vpcNo": "12345678",
"subnetNo": "23456789",
"isPublicSubnet": false,
"dataStorageType": {
"code": "SSD",
"codeName": "SSD"
},
"isStorageEncryption": false,
"dataStorageSize": 10737418240,
"cpuCount": 2,
"memorySize": 4294967296,
"createDate": "2026-06-09T18:40:14+0900"
}
]
}
],
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"returnCode": "0",
"returnMessage": "success"
}
}