All Products
Search
Document Center

Bastionhost:CreateDatabase

Last Updated:Dec 08, 2025

You can call this operation to import database assets into Bastionhost. You can import Alibaba Cloud databases, such as RDS for MySQL, SQL Server, and PostgreSQL, and PolarDB for MySQL, PostgreSQL, and PostgreSQL (Oracle compatible). You can also import self-managed databases that run MySQL, SQL Server, PostgreSQL, or Oracle.

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

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The ID of the Bastionhost instance.

Note

Call the DescribeInstances operation to obtain this parameter.

bastionhost-cn-7mz2g5hu20e

RegionId

string

No

The region ID of the Bastionhost instance.

Note

For a list of region IDs and their corresponding region names, see Regions and zones.

cn-shanghai

NetworkDomainId

string

No

The ID of the network domain for the new database.

Note

Call the ListNetworkDomains operation to obtain this parameter.

1

DatabaseType

string

Yes

The type of the database. Valid values:

  • MySQL

  • Oracle

  • PostgreSQL

  • SQLServer

MySQL

ActiveAddressType

string

Yes

The address type of the new database. Valid values:

  • Public: a public endpoint

  • Private: a private endpoint

Public

DatabasePrivateAddress

string

No

The private endpoint of the database. You can use an IPv4 address or a domain name.

Note

This parameter is required if you set ActiveAddressType to Private.

192.168.XX.XX

DatabasePublicAddress

string

No

The public endpoint of the database. You can use an IPv4 address or a domain name.

Note

This parameter is required if you set ActiveAddressType to Public.

www.example.com

DatabasePort

integer

No

The port used to connect to the database. This parameter is required if you set Source to Local.

5433

DatabaseName

string

No

The name of the new database instance. This parameter is required if you set Source to Local.

Test01

SourceInstanceId

string

No

The ID of the database instance.

Note

This parameter is required if you set Source to Rds or PolarDB.

i-bp19ienyt0yax748****

Source

string

Yes

The source of the new database. Valid values:

  • Local: a local database instance

  • Rds: an RDS database instance

  • PolarDB: a PolarDB database instance

Local

Comment

string

No

The comments on the new database. The comments can be up to 500 characters in length.

cpp

SourceInstanceRegionId

string

No

The region ID of the database instance.

Note

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

cn-shanghai

PolarDBEndpointType

string

No

This parameter is required if you set Source to PolarDB. This parameter specifies the endpoint type of the PolarDB database. Valid values:

  • Cluster: a cluster endpoint

  • Primary: a primary endpoint

Cluster

InstanceMemberId

integer

No

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

1605494xxxx

Response elements

Element

Type

Description

Example

object

DatabaseId

string

The ID of the database instance.

334

RequestId

string

The ID of the request.

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.