github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/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 ``` 18 resource "alicloud_db_instance" "default" { 19 commodity_code = "rds" 20 engine = "MySQL" 21 engine_version = "5.6" 22 db_instance_class = "rds.mysql.t1.small" 23 db_instance_storage = "10" 24 db_instance_net_type = "Intranet" 25 } 26 ``` 27 28 ## Argument Reference 29 30 The following arguments are supported: 31 32 * `engine` - (Required) Database type. Value options: MySQL, SQLServer, PostgreSQL, and PPAS. 33 * `engine_version` - (Required) Database version. Value options: 34 - 5.5/5.6/5.7 for MySQL 35 - 2008r2/2012 for SQLServer 36 - 9.4 for PostgreSQL 37 - 9.3 for PPAS 38 * `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). 39 * `db_instance_storage` - (Required) User-defined storage space. Value range: 40 - [5, 2000] for MySQL/PostgreSQL/PPAS HA dual node edition; 41 - [20,1000] for MySQL 5.7 basic single node edition; 42 - [10, 2000] for SQL Server 2008R2; 43 - [20,2000] for SQL Server 2012 basic single node edition 44 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). 45 * `instance_charge_type` - (Optional) Valid values are `Prepaid`, `Postpaid`, The default is `Postpaid`. 46 * `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]. 47 * `zone_id` - (Optional) Selected zone to create database instance. You cannot set the ZoneId parameter if the MultiAZ parameter is set to true. 48 * `multi_az` - (Optional) Specifies if the database instance is a multiple Availability Zone deployment. 49 * `db_instance_net_type` - (Optional) Network connection type of an instance. Internet: public network; Intranet: private network 50 * `allocate_public_connection` - (Optional) If set to true will applies for an Internet connection string of an instance. 51 * `instance_network_type` - (Optional) VPC: VPC instance; Classic: classic instance. If no value is specified, a classic instance will be created by default. 52 * `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. 53 * `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. 54 * `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. 55 * `preferred_backup_period` - (Optional) Backup period. Values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday. 56 * `preferred_backup_time` - (Optional) Backup time, in the format ofHH:mmZ- HH:mm Z. 57 * `backup_retention_period` - (Optional) Retention days of the backup (7 to 730 days). The default value is 7 days. 58 * `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]). 59 * `db_mappings` - (Optional) Database mappings to attach to db instance. See [Block database](#block-database) below for details. 60 61 62 ## Block database 63 64 The database mapping supports the following: 65 66 * `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. 67 * `character_set_name` - (Required) Character set. The value range is limited to the following: 68 - MySQL type: 69 + utf8 70 + gbk 71 + latin1 72 + utf8mb4 (included in versions 5.5 and 5.6). 73 - SQLServer type: 74 + Chinese_PRC_CI_AS 75 + Chinese_PRC_CS_AS 76 + SQL_Latin1_General_CP1_CI_AS 77 + SQL_Latin1_General_CP1_CS_AS 78 + Chinese_PRC_BIN 79 * `db_description` - (Optional) Database description, which cannot exceed 256 characters. NOTE: It cannot begin with https://. 80 81 82 ~> **NOTE:** We neither support modify any of database attribute, nor insert/remove item at the same time. 83 We recommend split to two separate operations. 84 85 ## Attributes Reference 86 87 The following attributes are exported: 88 89 * `id` - The RDS instance ID. 90 * `instance_charge_type` - The instance charge type. 91 * `period` - The time that you have bought the resource. 92 * `engine` - Database type. 93 * `engine_version` - The database engine version. 94 * `db_instance_class` - The RDS instance class. 95 * `db_instance_storage` - The amount of allocated storage. 96 * `port` - The database port. 97 * `zone_id` - The zone ID of the DB instance. 98 * `db_instance_net_type` - Network connection type of an instance, `Internet` or `Intranet`. 99 * `instance_network_type` - The instance network type and it has two values: `vpc` and `classic`. 100 * `db_mappings` - Database mappings attached to db instance. 101 * `preferred_backup_period` - Backup period. 102 * `preferred_backup_time` - Backup time. 103 * `backup_retention_period` - Retention days of the backup. 104 * `security_ips` - Security ips of instance whitelist. 105 * `connections` - Views all the connection information of a specified instance. 106