github.com/pmcatominey/terraform@v0.7.0-rc2.0.20160708105029-1401a52a5cc5/website/source/docs/providers/aws/r/rds_cluster_instance.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_rds_cluster_instance" 4 sidebar_current: "docs-aws-resource-rds-cluster-instance" 5 description: |- 6 Provides an RDS Cluster Resource Instance 7 --- 8 9 # aws\_rds\_cluster\_instance 10 11 Provides an RDS Cluster Resource Instance. A Cluster Instance Resource defines 12 attributes that are specific to a single instance in a [RDS Cluster][3], 13 specifically running Amazon Aurora. 14 15 Unlike other RDS resources that support replication, with Amazon Aurora you do 16 not designate a primary and subsequent replicas. Instead, you simply add RDS 17 Instances and Aurora manages the replication. You can use the [count][5] 18 meta-parameter to make multiple instances and join them all to the same RDS 19 Cluster, or you may specify different Cluster Instance resources with various 20 `instance_class` sizes. 21 22 For more information on Amazon Aurora, see [Aurora on Amazon RDS][2] in the Amazon RDS User Guide. 23 24 ## Example Usage 25 26 ``` 27 resource "aws_rds_cluster_instance" "cluster_instances" { 28 count = 2 29 identifier = "aurora-cluster-demo-${count.index}" 30 cluster_identifier = "${aws_rds_cluster.default.id}" 31 instance_class = "db.r3.large" 32 } 33 34 resource "aws_rds_cluster" "default" { 35 cluster_identifier = "aurora-cluster-demo" 36 availability_zones = ["us-west-2a","us-west-2b","us-west-2c"] 37 database_name = "mydb" 38 master_username = "foo" 39 master_password = "barbut8chars" 40 } 41 ``` 42 43 ## Argument Reference 44 45 For more detailed documentation about each argument, refer to 46 the [AWS official documentation](https://docs.aws.amazon.com/AmazonRDS/latest/CommandLineReference/CLIReference-cmd-ModifyDBInstance.html). 47 48 The following arguments are supported: 49 50 * `identifier` - (Optional) The Instance Identifier. Must be a lower case 51 string. If omitted, a unique identifier will be generated. 52 * `cluster_identifier` - (Required) The identifier of the [`aws_rds_cluster`](/docs/providers/aws/r/rds_cluster.html) in which to launch this instance. 53 * `instance_class` - (Required) The instance class to use. For details on CPU 54 and memory, see [Scaling Aurora DB Instances][4]. Aurora currently 55 supports the below instance classes. 56 - db.r3.large 57 - db.r3.xlarge 58 - db.r3.2xlarge 59 - db.r3.4xlarge 60 - db.r3.8xlarge 61 * `publicly_accessible` - (Optional) Bool to control if instance is publicly accessible. 62 Default `false`. See the documentation on [Creating DB Instances][6] for more 63 details on controlling this property. 64 * `db_subnet_group_name` - (Required if `publicly_accessible = false`, Optional otherwise) A DB subnet group to associate with this DB instance. **NOTE:** This must match the `db_subnet_group_name` of the attached [`aws_rds_cluster`](/docs/providers/aws/r/rds_cluster.html). 65 * `db_parameter_group_name` - (Optional) The name of the DB parameter group to associate with this instance. 66 * `apply_immediately` - (Optional) Specifies whether any database modifications 67 are applied immediately, or during the next maintenance window. Default is`false`. 68 * `tags` - (Optional) A mapping of tags to assign to the instance. 69 70 ## Attributes Reference 71 72 The following attributes are exported: 73 74 * `cluster_identifier` - The RDS Cluster Identifier 75 * `identifier` - The Instance identifier 76 * `id` - The Instance identifier 77 * `writer` – Boolean indicating if this instance is writable. `False` indicates 78 this instance is a read replica 79 * `allocated_storage` - The amount of allocated storage 80 * `availability_zones` - The availability zone of the instance 81 * `endpoint` - The IP address for this instance. May not be writable 82 * `engine` - The database engine 83 * `engine_version` - The database engine version 84 * `database_name` - The database name 85 * `port` - The database port 86 * `status` - The RDS instance status 87 88 [2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html 89 [3]: /docs/providers/aws/r/rds_cluster.html 90 [4]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html 91 [5]: /docs/configuration/resources.html#count 92 [6]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html