github.com/cbroglie/terraform@v0.7.0-rc3.0.20170410193827-735dfc416d46/website/source/docs/providers/alicloud/r/db_instance.html.markdown (about) 1 --- 2 layout: "alicloud" 3 page_title: "Alicloud: alicloud_db_instance" 4 sidebar_current: "docs-alicloud-resource-db-instance" 5 description: |- 6 Provides an RDS instance resource. 7 --- 8 9 # alicloud_db_instance 10 11 Provides an RDS instance resource. A DB instance is an isolated database 12 environment in the cloud. A DB instance can contain multiple user-created 13 databases. 14 15 ## Example Usage 16 17 ```hcl 18 resource "alicloud_db_instance" "default" { 19 commodity_code = "rds" 20 21 engine = "MySQL" 22 engine_version = "5.6" 23 24 db_instance_class = "rds.mysql.t1.small" 25 db_instance_storage = "10" 26 db_instance_net_type = "Intranet" 27 } 28 ``` 29 30 ## Argument Reference 31 32 The following arguments are supported: 33 34 * `engine` - (Required) Database type. Value options: MySQL, SQLServer, PostgreSQL, and PPAS. 35 * `engine_version` - (Required) Database version. Value options: 36 - 5.5/5.6/5.7 for MySQL 37 - 2008r2/2012 for SQLServer 38 - 9.4 for PostgreSQL 39 - 9.3 for PPAS 40 * `db_instance_class` - (Required) Instance type. For details, see [Instance type table](https://intl.aliyun.com/help/doc-detail/26312.htm?spm=a3c0i.o26228en.a3.2.bRUHF3). 41 * `db_instance_storage` - (Required) User-defined storage space. Value range: 42 - [5, 2000] for MySQL/PostgreSQL/PPAS HA dual node edition; 43 - [20,1000] for MySQL 5.7 basic single node edition; 44 - [10, 2000] for SQL Server 2008R2; 45 - [20,2000] for SQL Server 2012 basic single node edition 46 Increase progressively at a rate of 5 GB. The unit is GB. For details, see [Instance type table](https://intl.aliyun.com/help/doc-detail/26312.htm?spm=a3c0i.o26228en.a3.3.bRUHF3). 47 * `instance_charge_type` - (Optional) Valid values are `Prepaid`, `Postpaid`, The default is `Postpaid`. 48 * `period` - (Optional) The time that you have bought the resource, in month. Only valid when instance_charge_type is set as `PrePaid`. Value range [1, 12]. 49 * `zone_id` - (Optional) Selected zone to create database instance. You cannot set the ZoneId parameter if the MultiAZ parameter is set to true. 50 * `multi_az` - (Optional) Specifies if the database instance is a multiple Availability Zone deployment. 51 * `db_instance_net_type` - (Optional) Network connection type of an instance. Internet: public network; Intranet: private network 52 * `allocate_public_connection` - (Optional) If set to true will applies for an Internet connection string of an instance. 53 * `instance_network_type` - (Optional) VPC: VPC instance; Classic: classic instance. If no value is specified, a classic instance will be created by default. 54 * `vswitch_id` - (Optional) The virtual switch ID to launch in VPC. If you want to create instances in VPC network, this parameter must be set. 55 * `master_user_name` - (Optional) The master user name for the database instance. Operation account requiring a uniqueness check. It may consist of lower case letters, numbers and underlines, and must start with a letter and have no more than 16 characters. 56 * `master_user_password` - (Optional) The master password for the database instance. Operation password. It may consist of letters, digits, or underlines, with a length of 6 to 32 characters. 57 * `preferred_backup_period` - (Optional) Backup period. Values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday. 58 * `preferred_backup_time` - (Optional) Backup time, in the format ofHH:mmZ- HH:mm Z. 59 * `backup_retention_period` - (Optional) Retention days of the backup (7 to 730 days). The default value is 7 days. 60 * `security_ips` - (Optional) List of IP addresses under the IP address white list array. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]). 61 * `db_mappings` - (Optional) Database mappings to attach to db instance. See [Block database](#block-database) below for details. 62 63 64 ## Block database 65 66 The database mapping supports the following: 67 68 * `db_name` - (Required) Name of the database requiring a uniqueness check. It may consist of lower case letters, numbers and underlines, and must start with a letter and have no more than 64 characters. 69 * `character_set_name` - (Required) Character set. The value range is limited to the following: 70 - MySQL type: 71 + utf8 72 + gbk 73 + latin1 74 + utf8mb4 (included in versions 5.5 and 5.6). 75 - SQLServer type: 76 + Chinese_PRC_CI_AS 77 + Chinese_PRC_CS_AS 78 + SQL_Latin1_General_CP1_CI_AS 79 + SQL_Latin1_General_CP1_CS_AS 80 + Chinese_PRC_BIN 81 * `db_description` - (Optional) Database description, which cannot exceed 256 characters. NOTE: It cannot begin with https://. 82 83 84 ~> **NOTE:** We neither support modify any of database attribute, nor insert/remove item at the same time. 85 We recommend split to two separate operations. 86 87 ## Attributes Reference 88 89 The following attributes are exported: 90 91 * `id` - The RDS instance ID. 92 * `instance_charge_type` - The instance charge type. 93 * `period` - The time that you have bought the resource. 94 * `engine` - Database type. 95 * `engine_version` - The database engine version. 96 * `db_instance_class` - The RDS instance class. 97 * `db_instance_storage` - The amount of allocated storage. 98 * `port` - The database port. 99 * `zone_id` - The zone ID of the DB instance. 100 * `db_instance_net_type` - Network connection type of an instance, `Internet` or `Intranet`. 101 * `instance_network_type` - The instance network type and it has two values: `vpc` and `classic`. 102 * `db_mappings` - Database mappings attached to db instance. 103 * `preferred_backup_period` - Backup period. 104 * `preferred_backup_time` - Backup time. 105 * `backup_retention_period` - Retention days of the backup. 106 * `security_ips` - Security ips of instance whitelist. 107 * `connections` - Views all the connection information of a specified instance.