github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/website/source/docs/providers/aws/r/rds_cluster.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_rds_cluster" 4 sidebar_current: "docs-aws-resource-rds-cluster" 5 description: |- 6 Provides an RDS Cluster Resource 7 --- 8 9 # aws\_rds\_cluster 10 11 Provides an RDS Cluster Resource. A Cluster Resource defines attributes that are 12 applied to the entire cluster of [RDS Cluster Instances][3]. Use the RDS Cluster 13 resource and RDS Cluster Instances to create and use Amazon Aurora, a MySQL-compatible 14 database engine. 15 16 For more information on Amazon Aurora, see [Aurora on Amazon RDS][2] in the Amazon RDS User Guide. 17 18 Changes to a RDS Cluster can occur when you manually change a 19 parameter, such as `port`, and are reflected in the next maintenance 20 window. Because of this, Terraform may report a difference in it's planning 21 phase because a modification has not yet taken place. You can use the 22 `apply_immediately` flag to instruct the service to apply the change immediately 23 (see documentation below). 24 25 ~> **Note:** using `apply_immediately` can result in a 26 brief downtime as the server reboots. See the AWS Docs on [RDS Maintenance][4] 27 for more information. 28 29 ## Example Usage 30 31 ``` 32 resource "aws_rds_cluster" "default" { 33 cluster_identifier = "aurora-cluster-demo" 34 availability_zones = ["us-west-2a","us-west-2b","us-west-2c"] 35 database_name = "mydb" 36 master_username = "foo" 37 master_password = "bar" 38 backup_retention_period = 5 39 preferred_backup_window = "07:00-09:00" 40 } 41 ``` 42 43 ~> **NOTE:** RDS Clusters resources that are created without any matching 44 RDS Cluster Instances do not currently display in the AWS Console. 45 46 ## Argument Reference 47 48 For more detailed documentation about each argument, refer to 49 the [AWS official documentation](https://docs.aws.amazon.com/AmazonRDS/latest/CommandLineReference/CLIReference-cmd-ModifyDBInstance.html). 50 51 The following arguments are supported: 52 53 * `cluster_identifier` - (Required) The Cluster Identifier. Must be a lower case 54 string. 55 * `database_name` - (Optional) The name for your database of up to 8 alpha-numeric 56 characters. If you do not provide a name, Amazon RDS will not create a 57 database in the DB cluster you are creating 58 * `master_password` - (Required unless a `snapshot_identifier` is provided) Password for the master DB user. Note that this may 59 show up in logs, and it will be stored in the state file 60 * `master_username` - (Required unless a `snapshot_identifier` is provided) Username for the master DB user 61 * `final_snapshot_identifier` - (Optional) The name of your final DB snapshot 62 when this DB cluster is deleted. If omitted, no final snapshot will be 63 made. 64 * `skip_final_snapshot` - (Optional) Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DBSnapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `final_snapshot_identifier`. Default is true. 65 * `availability_zones` - (Optional) A list of EC2 Availability Zones that 66 instances in the DB cluster can be created in 67 * `backup_retention_period` - (Optional) The days to retain backups for. Default 68 1 69 * `preferred_backup_window` - (Optional) The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter. 70 Default: A 30-minute window selected at random from an 8-hour block of time per region. e.g. 04:00-09:00 71 * `preferred_maintenance_window` - (Optional) The weekly time range during which system maintenance can occur, in (UTC) e.g. wed:04:00-wed:04:30 72 * `port` - (Optional) The port on which the DB accepts connections 73 * `vpc_security_group_ids` - (Optional) List of VPC security groups to associate 74 with the Cluster 75 * `snapshot_identifier` - (Optional) Specifies whether or not to create this cluster from a snapshot. This correlates to the snapshot ID you'd find in the RDS console, e.g: rds:production-2015-06-26-06-05. 76 * `storage_encrypted` - (Optional) Specifies whether the DB cluster is encrypted. The default is `false` if not specified. 77 * `apply_immediately` - (Optional) Specifies whether any cluster modifications 78 are applied immediately, or during the next maintenance window. Default is 79 `false`. See [Amazon RDS Documentation for more information.](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html) 80 * `db_subnet_group_name` - (Optional) A DB subnet group to associate with this DB instance. **NOTE:** This must match the `db_subnet_group_name` specified on every [`aws_rds_cluster_instance`](/docs/providers/aws/r/rds_cluster_instance.html) in the cluster. 81 * `db_cluster_parameter_group_name` - (Optional) A cluster parameter group to associate with the cluster. 82 83 ## Attributes Reference 84 85 The following attributes are exported: 86 87 * `id` - The RDS Cluster Identifier 88 * `cluster_identifier` - The RDS Cluster Identifier 89 * `cluster_members` – List of RDS Instances that are a part of this cluster 90 * `address` - The address of the RDS instance. 91 * `allocated_storage` - The amount of allocated storage 92 * `availability_zones` - The availability zone of the instance 93 * `backup_retention_period` - The backup retention period 94 * `preferred_backup_window` - The backup window 95 * `preferred_maintenance_window` - The maintenance window 96 * `endpoint` - The primary, writeable connection endpoint 97 * `engine` - The database engine 98 * `engine_version` - The database engine version 99 * `maintenance_window` - The instance maintenance window 100 * `database_name` - The database name 101 * `port` - The database port 102 * `status` - The RDS instance status 103 * `username` - The master username for the database 104 * `storage_encrypted` - Specifies whether the DB cluster is encrypted 105 * `preferred_backup_window` - The daily time range during which the backups happen 106 107 [1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.Replication.html 108 109 [2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html 110 [3]: /docs/providers/aws/r/rds_cluster_instance.html 111 [4]: http://docs.aws.amazon.com/fr_fr/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html