github.com/koding/terraform@v0.6.4-0.20170608090606-5d7e0339779d/website/source/docs/providers/aws/r/elasticache_replication_group.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_elasticache_replication_group" 4 sidebar_current: "docs-aws-resource-elasticache-replication-group" 5 description: |- 6 Provides an ElastiCache Replication Group resource. 7 --- 8 9 # aws\_elasticache\_replication\_group 10 11 Provides an ElastiCache Replication Group resource. 12 13 ## Example Usage 14 15 ### Redis Master with One Replica 16 17 ```hcl 18 resource "aws_elasticache_replication_group" "bar" { 19 replication_group_id = "tf-rep-group-1" 20 replication_group_description = "test description" 21 node_type = "cache.m1.small" 22 number_cache_clusters = 2 23 port = 6379 24 parameter_group_name = "default.redis3.2" 25 availability_zones = ["us-west-2a", "us-west-2b"] 26 automatic_failover_enabled = true 27 } 28 ``` 29 30 ### Native Redis Cluser 2 Masters 2 Replicas 31 32 ```hcl 33 resource "aws_elasticache_replication_group" "baz" { 34 replication_group_id = "tf-redis-cluster" 35 replication_group_description = "test description" 36 node_type = "cache.m1.small" 37 port = 6379 38 parameter_group_name = "default.redis3.2.cluster.on" 39 automatic_failover_enabled = true 40 cluster_mode { 41 replicas_per_node_group = 1 42 num_node_groups = 2 43 } 44 } 45 ``` 46 47 ~> **Note:** We currently do not support passing a `primary_cluster_id` in order to create the Replication Group. 48 49 ~> **Note:** Automatic Failover is unavailable for Redis versions earlier than 2.8.6, 50 and unavailable on T1 and T2 node types. See the [Amazon Replication with 51 Redis](http://docs.aws.amazon.com/en_en/AmazonElastiCache/latest/UserGuide/Replication.html) guide 52 for full details on using Replication Groups. 53 54 ## Argument Reference 55 56 The following arguments are supported: 57 58 * `replication_group_id` – (Required) The replication group identifier. This parameter is stored as a lowercase string. 59 * `replication_group_description` – (Required) A user-created description for the replication group. 60 * `number_cache_clusters` - (Required) The number of cache clusters this replication group will have. 61 If Multi-AZ is enabled , the value of this parameter must be at least 2. Changing this number will force a new resource 62 * `node_type` - (Required) The compute and memory capacity of the nodes in the node group. 63 * `automatic_failover_enabled` - (Optional) Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. Defaults to `false`. 64 * `auto_minor_version_upgrade` - (Optional) Specifies whether a minor engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Defaults to `true`. 65 * `availability_zones` - (Optional) A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important. 66 * `engine_version` - (Optional) The version number of the cache engine to be used for the cache clusters in this replication group. 67 * `parameter_group_name` - (Optional) The name of the parameter group to associate with this replication group. If this argument is omitted, the default cache parameter group for the specified engine is used. 68 * `port` – (Required) The port number on which each of the cache nodes will accept connections. For Memcache the default is 11211, and for Redis the default port is 6379. 69 * `subnet_group_name` - (Optional) The name of the cache subnet group to be used for the replication group. 70 * `security_group_names` - (Optional) A list of cache security group names to associate with this replication group. 71 * `security_group_ids` - (Optional) One or more Amazon VPC security groups associated with this replication group. Use this parameter only when you are creating a replication group in an Amazon Virtual Private Cloud 72 * `snapshot_arns` – (Optional) A single-element string list containing an 73 Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. 74 Example: `arn:aws:s3:::my_bucket/snapshot1.rdb` 75 * `snapshot_name` - (Optional) The name of a snapshot from which to restore data into the new node group. Changing the `snapshot_name` forces a new resource. 76 * `maintenance_window` – (Optional) Specifies the weekly time range for when maintenance 77 on the cache cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi` (24H Clock UTC). 78 The minimum maintenance window is a 60 minute period. Example: `sun:05:00-sun:09:00` 79 * `notification_topic_arn` – (Optional) An Amazon Resource Name (ARN) of an 80 SNS topic to send ElastiCache notifications to. Example: 81 `arn:aws:sns:us-east-1:012345678999:my_sns_topic` 82 * `snapshot_window` - (Optional, Redis only) The daily time range (in UTC) during which ElastiCache will 83 begin taking a daily snapshot of your cache cluster. Example: 05:00-09:00 84 * `snapshot_retention_limit` - (Optional, Redis only) The number of days for which ElastiCache will 85 retain automatic cache cluster snapshots before deleting them. For example, if you set 86 SnapshotRetentionLimit to 5, then a snapshot that was taken today will be retained for 5 days 87 before being deleted. If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off. 88 Please note that setting a `snapshot_retention_limit` is not supported on cache.t1.micro or cache.t2.* cache nodes 89 * `apply_immediately` - (Optional) Specifies whether any modifications are applied immediately, or during the next maintenance window. Default is `false`. 90 * `tags` - (Optional) A mapping of tags to assign to the resource 91 * `cluster_mode` - (Optional) Create a native redis cluster. `automatic_failover_enabled` must be set to true. Cluster Mode documented below. Only 1 `cluster_mode` block is allowed. 92 93 Cluster Mode (`cluster_mode`) supports the following: 94 95 * `replicas_per_node_group` - (Required) Specify the number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource. 96 * `num_node_groups` - (Required) Specify the number of node groups (shards) for this Redis replication group. Changing this number will force a new resource. 97 98 ## Attributes Reference 99 100 The following attributes are exported: 101 102 * `id` - The ID of the ElastiCache Replication Group. 103 * `primary_endpoint_address` - The address of the endpoint for the primary node in the replication group. If Redis, only present when cluster mode is disabled. 104 * `configuration_endpoint_address` - (Redis only) The address of the replication group configuration endpoint when cluster mode is enabled. 105 106 ## Import 107 108 ElastiCache Replication Groups can be imported using the `replication_group_id`, e.g. 109 110 ``` 111 $ terraform import aws_elasticache_replication_group.my_replication_group replication-group-1 112 ```