github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/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  ```hcl
    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, Forces new resource) The indentifier for the RDS instance, if omitted, Terraform will assign a random, unique identifier.
    51  * `identifier_prefix` - (Optional, Forces new resource) Creates a unique identifier beginning with the specified prefix. Conflicts with `identifer`.
    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  * `preferred_backup_window` - (Optional) The daily time range during which automated backups are created if automated backups are enabled.
    75    Eg: "04:00-09:00"
    76  * `preferred_maintenance_window` - (Optional) The window to perform maintenance in.
    77    Syntax: "ddd:hh24:mi-ddd:hh24:mi". Eg: "Mon:00:00-Mon:03:00".
    78  * `auto_minor_version_upgrade` - (Optional) Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. Default `true`.
    79  * `tags` - (Optional) A mapping of tags to assign to the instance.
    80  
    81  ## Attributes Reference
    82  
    83  The following attributes are exported:
    84  
    85  * `cluster_identifier` - The RDS Cluster Identifier
    86  * `identifier` - The Instance identifier
    87  * `id` - The Instance identifier
    88  * `writer` – Boolean indicating if this instance is writable. `False` indicates
    89  this instance is a read replica
    90  * `allocated_storage` - The amount of allocated storage
    91  * `availability_zones` - The availability zone of the instance
    92  * `endpoint` - The DNS address for this instance. May not be writable
    93  * `engine` - The database engine
    94  * `engine_version` - The database engine version
    95  * `database_name` - The database name
    96  * `port` - The database port
    97  * `status` - The RDS instance status
    98  * `storage_encrypted` - Specifies whether the DB cluster is encrypted.
    99  * `kms_key_id` - The ARN for the KMS encryption key if one is set to the cluster.
   100  
   101  [2]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html
   102  [3]: /docs/providers/aws/r/rds_cluster.html
   103  [4]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html
   104  [5]: /docs/configuration/resources.html#count
   105  [6]: https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html
   106  
   107  ## Import
   108  
   109  RDS Cluster Instances can be imported using the `identifier`, e.g.
   110  
   111  ```
   112  $ terraform import aws_rds_cluster_instance.prod_instance_1 aurora-cluster-instance-1
   113  ```