github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/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  
    66  ## Attributes Reference
    67  
    68  The following attributes are exported:
    69  
    70  * `cluster_identifier` - The RDS Cluster Identifier
    71  * `identifier` - The Instance identifier
    72  * `id` - The Instance identifier
    73  * `writer` – Boolean indicating if this instance is writable. `False` indicates
    74  this instance is a read replica
    75  * `allocated_storage` - The amount of allocated storage
    76  * `availability_zones` - The availability zone of the instance
    77  * `endpoint` - The IP address for this instance. May not be writable
    78  * `engine` - The database engine
    79  * `engine_version` - The database engine version
    80  * `database_name` - The database name
    81  * `port` - The database port
    82  * `status` - The RDS instance status
    83  
    84  [2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html
    85  [3]: /docs/providers/aws/r/rds_cluster.html
    86  [4]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html
    87  [5]: /docs/configuration/resources.html#count
    88  [6]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html