github.com/nicgrayson/terraform@v0.4.3-0.20150415203910-c4de50829380/website/source/docs/providers/aws/r/db_instance.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_db_instance" 4 sidebar_current: "docs-aws-resource-db-instance" 5 description: |- 6 Provides an RDS instance resource. 7 --- 8 9 # aws\_db\_instance 10 11 Provides an RDS instance resource. 12 13 ## Example Usage 14 15 ``` 16 resource "aws_db_instance" "default" { 17 identifier = "mydb-rds" 18 allocated_storage = 10 19 engine = "mysql" 20 engine_version = "5.6.17" 21 instance_class = "db.t1.micro" 22 name = "mydb" 23 username = "foo" 24 password = "bar" 25 db_subnet_group_name = "my_database_subnet_group" 26 parameter_group_name = "default.mysql5.6" 27 } 28 ``` 29 30 ## Argument Reference 31 32 The following arguments are supported: 33 34 * `allocated_storage` - (Required) The allocated storage in gigabytes. 35 * `engine` - (Required) The database engine to use. 36 * `engine_version` - (Required) The engine version to use. 37 * `identifier` - (Required) The name of the RDS instance 38 * `instance_class` - (Required) The instance type of the RDS instance. 39 * `storage_type` - (Optional) One of "standard" (magnetic), "gp2" (general 40 purpose SSD), or "io1" (provisioned IOPS SSD). The default is "io1" if 41 `iops` is specified, "standard" if not. 42 * `final_snapshot_identifier` - (Optional) The name of your final DB snapshot 43 when this DB instance is deleted. If omitted, no final snapshot will be 44 made. 45 * `name` - (Optional) The DB name to create. If omitted, no database is created 46 initially. 47 * `password` - (Required) Password for the master DB user. Note that this may 48 show up in logs, and it will be stored in the state file. 49 * `username` - (Required) Username for the master DB user. 50 * `availability_zone` - (Optional) The AZ for the RDS instance. 51 * `backup_retention_period` - (Optional) The days to retain backups for. 52 * `backup_window` - (Optional) The backup window. 53 * `iops` - (Optional) The amount of provisioned IOPS. Setting this implies a 54 storage_type of "io1". 55 * `maintenance_window` - (Optional) The window to perform maintenance in. 56 * `multi_az` - (Optional) Specifies if the RDS instance is multi-AZ 57 * `port` - (Optional) The port on which the DB accepts connections. 58 * `publicly_accessible` - (Optional) Bool to control if instance is publicly accessible. 59 * `vpc_security_group_ids` - (Optional) List of VPC security groups to associate. 60 * `security_group_names` - (Optional/Deprecated) List of DB Security Groups to associate. 61 Only used for [DB Instances on the _EC2-Classic_ Platform](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.html#USER_VPC.FindDefaultVPC). 62 * `db_subnet_group_name` - (Optional) Name of DB subnet group 63 * `parameter_group_name` - (Optional) Name of the DB parameter group to associate. 64 * `storage_encrypted` - (Optional) Specifies whether the DB instance is encrypted. The default is `false` if not specified. 65 * `apply_immediately` - (Optional) Specifies whether any database modifications 66 are applied immediately, or during the next maintenance window. Default is 67 `false`. See [Amazon RDS Documentation for more for more information.](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html) 68 69 ## Attributes Reference 70 71 The following attributes are exported: 72 73 * `id` - The RDS instance ID. 74 * `address` - The address of the RDS instance. 75 * `allocated_storage` - The amount of allocated storage 76 * `availability_zone` - The availability zone of the instance 77 * `backup_retention_period` - The backup retention period 78 * `backup_window` - The backup window 79 * `endpoint` - The connection endpoint 80 * `engine` - The database engine 81 * `engine_version` - The database engine version 82 * `instance_class`- The RDS instance class 83 * `maintenance_window` - The instance maintenance window 84 * `multi_az` - If the RDS instance is multi AZ enabled 85 * `name` - The database name 86 * `port` - The database port 87 * `status` - The RDS instance status 88 * `username` - The master username for the database 89 * `storage_encrypted` - Specifies whether the DB instance is encrypted 90