2014-07-24 05:34:59 +02:00
|
|
|
---
|
|
|
|
layout: "aws"
|
|
|
|
page_title: "AWS: aws_db_instance"
|
|
|
|
sidebar_current: "docs-aws-resource-db-instance"
|
2014-10-22 05:21:56 +02:00
|
|
|
description: |-
|
|
|
|
Provides an RDS instance resource.
|
2014-07-24 05:34:59 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# aws\_db\_instance
|
|
|
|
|
|
|
|
Provides an RDS instance resource.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "aws_db_instance" "default" {
|
|
|
|
identifier = "mydb-rds"
|
|
|
|
allocated_storage = 10
|
|
|
|
engine = "mysql"
|
|
|
|
engine_version = "5.6.17"
|
|
|
|
instance_class = "db.t1.micro"
|
|
|
|
name = "mydb"
|
|
|
|
username = "foo"
|
|
|
|
password = "bar"
|
|
|
|
security_group_names = ["${aws_db_security_group.bar.name}"]
|
2014-10-27 22:48:03 +01:00
|
|
|
db_subnet_group_name = "my_database_subnet_group"
|
2014-10-22 23:22:30 +02:00
|
|
|
parameter_group_name = "default.mysql5.6"
|
2014-07-24 05:34:59 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `allocated_storage` - (Required) The allocated storage in gigabytes.
|
|
|
|
* `engine` - (Required) The database engine to use.
|
|
|
|
* `engine_version` - (Required) The engine version to use.
|
|
|
|
* `identifier` - (Required) The name of the RDS instance
|
|
|
|
* `instance_class` - (Required) The instance type of the RDS instance.
|
2014-08-01 17:34:46 +02:00
|
|
|
* `final_snapshot_identifier` - (Optional) The name of your final DB snapshot.
|
2014-07-24 05:34:59 +02:00
|
|
|
* `name` - (Required) The DB name to create.
|
2014-09-18 22:21:08 +02:00
|
|
|
* `password` - (Required) Password for the master DB user. Note that this will be stored
|
|
|
|
in the state file.
|
2014-07-24 05:34:59 +02:00
|
|
|
* `username` - (Required) Username for the master DB user.
|
|
|
|
* `availability_zone` - (Optional) The AZ for the RDS instance.
|
|
|
|
* `backup_retention_period` - (Optional) The days to retain backups for.
|
|
|
|
* `backup_window` - (Optional) The backup window.
|
|
|
|
* `iops` - (Optional) The amount of provisioned IOPS
|
2014-07-29 08:51:24 +02:00
|
|
|
* `maintenance_window` - (Optional) The window to perform maintenance in.
|
2014-07-24 05:34:59 +02:00
|
|
|
* `multi_az` - (Optional) Specifies if the RDS instance is multi-AZ
|
2014-07-29 08:51:24 +02:00
|
|
|
* `port` - (Optional) The port on which the DB accepts connections.
|
|
|
|
* `publicly_accessible` - (Optional) Bool to control if instance is publicly accessible.
|
2014-07-24 05:34:59 +02:00
|
|
|
* `vpc_security_group_ids` - (Optional) List of VPC security groups to associate.
|
|
|
|
* `skip_final_snapshot` - (Optional) Enables skipping the final snapshot on deletion.
|
|
|
|
* `security_group_names` - (Optional) List of DB Security Groups to associate.
|
2014-10-21 13:52:32 +02:00
|
|
|
* `db_subnet_group_name` - (Optional) Name of DB subnet group
|
2014-10-22 23:22:30 +02:00
|
|
|
* `parameter_group_name` - (Optional) Name of the DB parameter group to associate.
|
2014-07-24 05:34:59 +02:00
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The RDS instance ID.
|
|
|
|
* `address` - The address of the RDS instance.
|
|
|
|
* `allocated_storage` - The amount of allocated storage
|
|
|
|
* `availability_zone` - The availability zone of the instance
|
|
|
|
* `backup_retention_period` - The backup retention period
|
|
|
|
* `backup_window` - The backup window
|
|
|
|
* `endpoint` - The connection endpoint
|
|
|
|
* `engine` - The database engine
|
|
|
|
* `engine_version` - The database engine version
|
|
|
|
* `instance_class`- The RDS instance class
|
|
|
|
* `maintenance_window` - The instance maintenance window
|
|
|
|
* `multi_az` - If the RDS instance is multi AZ enabled
|
|
|
|
* `name` - The database name
|
|
|
|
* `port` - The database port
|
|
|
|
* `status` - The RDS instance status
|
|
|
|
* `username` - The master username for the database
|
|
|
|
|