diff --git a/docs/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database.md b/docs/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database.md new file mode 100644 index 00000000..f735a0ad --- /dev/null +++ b/docs/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database.md @@ -0,0 +1,59 @@ +--- +title: Provision an RDS instance with more than one database +--- + +In the guide [Provision and Binding Cloud Resources](./provision-and-consume-cloud-services) and [Provision a Database and Import a SQL File for initialization](./provision-and-initiate-database), +only one database will be created in an RDS instance. This tutorial will show you how to create more than one database in an RDS instance. + +In the [reference doc for Alibaba Cloud RDS](./terraform/alibaba-rds), set `database_name` if you want to create one database. +If you want to create more than one database, set `databases` to array of databases. Each database is a map, the map +contains the following attributes: name, character_set, description. + +``` +[ + { + "name" : "test", + "character_set" : "utf8", + "description" : "test database" + }, + { + "name" : "test2", + "character_set" : "utf8", + "description" : "test database" + } + ] +``` + +| Name | Description | Type | Required | Default | +|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|----------|---------| +| database_name | Database name | string | false | | +| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | | + +Applying the following application can create more than one database in an RDS instance. + +> ⚠️ This section requires your platform engineers have already enabled [cloud resources addon](../../../reference/addons/terraform). + +```yaml +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + name: alibaba-rds-multiple-databases +spec: + components: + - name: db + type: alibaba-rds + properties: + instance_name: dblinks + account_name: oamtest + password: U34rfwefwefffaked + databases: + - name: dev + character_set: utf8 + description: "dev database" + - name: prod + character_set: utf8 + description: "prod database" + writeConnectionSecretToRef: + name: db-conn + +``` diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-databases.md b/i18n/zh/docusaurus-plugin-content-docs/current/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-databases.md new file mode 100644 index 00000000..00aa11ca --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/current/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-databases.md @@ -0,0 +1,59 @@ +--- +title: RDS 实例创建多数据库 +--- + +指南 [创建和使用云资源](./provision-and-consume-cloud-services)和[数据库创建和初始化](./provision-and-initiate-database)里,在一个 +RDS 实例中,只创建了一个数据库。本教程将告诉你如何在一个 RDS 实例中创建多个数据库。 + +在[阿里云 RDS 参考文档](./terraform/alibaba-rds)中,如果你想创建一个数据库,请设置`database_name`。 如果你想创建多个数据库, +设置 `databases`,它是一个数据库列表,每个数据库都是一个 map,包含属性:name、character_set、description。 + +``` +[ + { + "name" : "test", + "character_set" : "utf8", + "description" : "test database" + }, + { + "name" : "test2", + "character_set" : "utf8", + "description" : "test database" + } + ] +``` + +| 名称 | 描述 | 类型 | 是否必须 | 默认值 | +|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|-------|-----| +| database_name | Database name | string | false | | +| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | | + +执行以下 Yaml 文件可以在 RDS 实例中创建多个数据库。 + +> ⚠️ 请确认管理员已经安装了 [云资源插件](../../../reference/addons/terraform)。 + +```yaml +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + name: alibaba-rds-multiple-databases +spec: + components: + - name: db + type: alibaba-rds + properties: + instance_name: dblinks + account_name: oamtest + password: U34rfwefwefffaked + databases: + - name: dev + character_set: utf8 + description: "dev database" + - name: prod + character_set: utf8 + description: "prod database" + writeConnectionSecretToRef: + name: db-conn + +``` + diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-v1.2/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-databases.md b/i18n/zh/docusaurus-plugin-content-docs/version-v1.2/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-databases.md new file mode 100644 index 00000000..00aa11ca --- /dev/null +++ b/i18n/zh/docusaurus-plugin-content-docs/version-v1.2/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-databases.md @@ -0,0 +1,59 @@ +--- +title: RDS 实例创建多数据库 +--- + +指南 [创建和使用云资源](./provision-and-consume-cloud-services)和[数据库创建和初始化](./provision-and-initiate-database)里,在一个 +RDS 实例中,只创建了一个数据库。本教程将告诉你如何在一个 RDS 实例中创建多个数据库。 + +在[阿里云 RDS 参考文档](./terraform/alibaba-rds)中,如果你想创建一个数据库,请设置`database_name`。 如果你想创建多个数据库, +设置 `databases`,它是一个数据库列表,每个数据库都是一个 map,包含属性:name、character_set、description。 + +``` +[ + { + "name" : "test", + "character_set" : "utf8", + "description" : "test database" + }, + { + "name" : "test2", + "character_set" : "utf8", + "description" : "test database" + } + ] +``` + +| 名称 | 描述 | 类型 | 是否必须 | 默认值 | +|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|-------|-----| +| database_name | Database name | string | false | | +| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | | + +执行以下 Yaml 文件可以在 RDS 实例中创建多个数据库。 + +> ⚠️ 请确认管理员已经安装了 [云资源插件](../../../reference/addons/terraform)。 + +```yaml +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + name: alibaba-rds-multiple-databases +spec: + components: + - name: db + type: alibaba-rds + properties: + instance_name: dblinks + account_name: oamtest + password: U34rfwefwefffaked + databases: + - name: dev + character_set: utf8 + description: "dev database" + - name: prod + character_set: utf8 + description: "prod database" + writeConnectionSecretToRef: + name: db-conn + +``` + diff --git a/sidebars.js b/sidebars.js index 01efc177..5aa49ec9 100644 --- a/sidebars.js +++ b/sidebars.js @@ -98,6 +98,7 @@ module.exports = { "end-user/components/cloud-services/provision-and-consume-cloud-services", "end-user/components/cloud-services/provision-and-initiate-database", "end-user/components/cloud-services/secure-your-database-connection", + "end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database", ], }, "end-user/traits/rollout", diff --git a/versioned_docs/version-v1.2/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database.md b/versioned_docs/version-v1.2/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database.md new file mode 100644 index 00000000..f735a0ad --- /dev/null +++ b/versioned_docs/version-v1.2/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database.md @@ -0,0 +1,59 @@ +--- +title: Provision an RDS instance with more than one database +--- + +In the guide [Provision and Binding Cloud Resources](./provision-and-consume-cloud-services) and [Provision a Database and Import a SQL File for initialization](./provision-and-initiate-database), +only one database will be created in an RDS instance. This tutorial will show you how to create more than one database in an RDS instance. + +In the [reference doc for Alibaba Cloud RDS](./terraform/alibaba-rds), set `database_name` if you want to create one database. +If you want to create more than one database, set `databases` to array of databases. Each database is a map, the map +contains the following attributes: name, character_set, description. + +``` +[ + { + "name" : "test", + "character_set" : "utf8", + "description" : "test database" + }, + { + "name" : "test2", + "character_set" : "utf8", + "description" : "test database" + } + ] +``` + +| Name | Description | Type | Required | Default | +|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|----------|---------| +| database_name | Database name | string | false | | +| databases | The database list, each database is a map, the map contains the following attributes: name, character_set, description, like `[{"name":"test","character_set":"utf8","description":"test database"},]`. It conflicts with `database_name`. | list(map(string)) | false | | + +Applying the following application can create more than one database in an RDS instance. + +> ⚠️ This section requires your platform engineers have already enabled [cloud resources addon](../../../reference/addons/terraform). + +```yaml +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + name: alibaba-rds-multiple-databases +spec: + components: + - name: db + type: alibaba-rds + properties: + instance_name: dblinks + account_name: oamtest + password: U34rfwefwefffaked + databases: + - name: dev + character_set: utf8 + description: "dev database" + - name: prod + character_set: utf8 + description: "prod database" + writeConnectionSecretToRef: + name: db-conn + +``` diff --git a/versioned_sidebars/version-v1.2-sidebars.json b/versioned_sidebars/version-v1.2-sidebars.json index 43647888..3826ccc9 100644 --- a/versioned_sidebars/version-v1.2-sidebars.json +++ b/versioned_sidebars/version-v1.2-sidebars.json @@ -202,6 +202,10 @@ { "type": "doc", "id": "version-v1.2/end-user/components/cloud-services/secure-your-database-connection" + }, + { + "type": "doc", + "id": "version-v1.2/end-user/components/cloud-services/provision-an-RDS-instance-with-more-than-one-database" } ] },