github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/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.t2.medium 57 - db.r3.large 58 - db.r3.xlarge 59 - db.r3.2xlarge 60 - db.r3.4xlarge 61 - db.r3.8xlarge 62 * `publicly_accessible` - (Optional) Bool to control if instance is publicly accessible. 63 Default `false`. See the documentation on [Creating DB Instances][6] for more 64 details on controlling this property. 65 * `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). 66 * `db_parameter_group_name` - (Optional) The name of the DB parameter group to associate with this instance. 67 * `apply_immediately` - (Optional) Specifies whether any database modifications 68 are applied immediately, or during the next maintenance window. Default is`false`. 69 * `monitoring_role_arn` - (Optional) The ARN for the IAM role that permits RDS to send 70 enhanced monitoring metrics to CloudWatch Logs. You can find more information on the [AWS Documentation](http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html) 71 what IAM permissions are needed to allow Enhanced Monitoring for RDS Instances. 72 * `monitoring_interval` - (Optional) The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance. To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60. 73 * `promotion_tier` - (Optional) Default 0. Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoter to writer 74 * `tags` - (Optional) A mapping of tags to assign to the instance. 75 76 ## Attributes Reference 77 78 The following attributes are exported: 79 80 * `cluster_identifier` - The RDS Cluster Identifier 81 * `identifier` - The Instance identifier 82 * `id` - The Instance identifier 83 * `writer` – Boolean indicating if this instance is writable. `False` indicates 84 this instance is a read replica 85 * `allocated_storage` - The amount of allocated storage 86 * `availability_zones` - The availability zone of the instance 87 * `endpoint` - The DNS address for this instance. May not be writable 88 * `engine` - The database engine 89 * `engine_version` - The database engine version 90 * `database_name` - The database name 91 * `port` - The database port 92 * `status` - The RDS instance status 93 * `storage_encrypted` - Specifies whether the DB cluster is encrypted. 94 * `kms_key_id` - The ARN for the KMS encryption key if one is set to the cluster. 95 96 [2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html 97 [3]: /docs/providers/aws/r/rds_cluster.html 98 [4]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html 99 [5]: /docs/configuration/resources.html#count 100 [6]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html 101 102 ## Import 103 104 RDS Cluster Instances can be imported using the `identifier`, e.g. 105 106 ``` 107 $ terraform import aws_rds_cluster_instance.prod_instance_1 aurora-cluster-instance-1 108 ```