All Products
Search
Document Center

Bastionhost:CreateDatabase

Last Updated:Aug 11, 2026

Imports database assets into a bastion host. Supported database types include MySQL, SQL Server, and PostgreSQL for ApsaraDB RDS instances, MySQL, PostgreSQL, and PostgreSQL (Compatible with Oracle) for PolarDB clusters, and MySQL, SQL Server, PostgreSQL, and Oracle for self-managed databases.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

yundun-bastionhost:CreateDatabase

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The ID of the bastion host instance.

Note

You can call the DescribeInstances operation to obtain this parameter.

bastionhost-cn-7mz2g5hu20e

RegionId

string

No

The region ID of the bastion host.

Note

For the mapping between region IDs and region names, see Regions and zones.

cn-shanghai

NetworkDomainId

string

No

The ID of the network domain to which the new database belongs.

Note

You can call the ListNetworkDomains operation to obtain this parameter.

1

DatabaseType

string

Yes

The database type. Valid values:

  • MySQL

  • Oracle

  • PostgreSQL

  • SQLServer

MySQL

ActiveAddressType

string

Yes

The address type of the new database. Valid values:

  • Public: public address

  • Private: private network address

Public

DatabasePrivateAddress

string

No

The private network address. IPv4 addresses and domain name formats are supported.

Note

This parameter is required when ActiveAddressType is set to Private.

192.168.XX.XX

DatabasePublicAddress

string

No

The public address. IPv4 addresses and domain name formats are supported.

Note

This parameter is required when ActiveAddressType is set to Public.

www.example.com

DatabasePort

integer

No

The port used to access the database. This parameter is required when the database source is Local.

5433

DatabaseName

string

No

The name of the new database instance. This parameter is required when the database source is Local.

Test01

SourceInstanceId

string

No

The instance ID of the new database.

Note

This parameter is required when Source is set to Rds or PolarDB.

i-bp19ienyt0yax748****

Source

string

Yes

The source of the new database. Valid values:

  • Local: self-managed database instance

  • Rds: ApsaraDB RDS instance

  • PolarDB: PolarDB cluster

Local

Comment

string

No

The remarks of the new database. The value can be up to 500 characters in length.

cpp

SourceInstanceRegionId

string

No

The region ID of the new database instance.

Note

This parameter is required when Source is set to Rds or PolarDB.

cn-shanghai

PolarDBEndpointType

string

No

The endpoint type of the PolarDB cluster. This parameter is required when Source is set to PolarDB. Valid values:

  • Cluster: cluster endpoint

  • Primary: primary endpoint

Cluster

InstanceMemberId

integer

No

The ID of the Alibaba Cloud account to which the new ApsaraDB RDS or PolarDB database instance belongs.

1605494xxxx

No

The project ID.

Response elements

Element

Type

Description

Example

object

DatabaseId

string

The instance ID of the database.

334

RequestId

string

The request ID.

98EDD923-236C-5A88-88E7-4979A91B9325

Examples

Success response

JSON format

{
  "DatabaseId": "334",
  "RequestId": "98EDD923-236C-5A88-88E7-4979A91B9325"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The argument is invalid. The argument is invalid.
400 LicenseOutOfLimit The maximum number of hosts exceeds the license limit. The maximum number of hosts exceeds the license limit.
400 DatabaseAlreadyExists The database already exists. The database already exists.
500 InternalError An unknown error occurred. An unknown error occurred.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.