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