3.3 KiB
layout | page_title | sidebar_current | description |
---|---|---|---|
aws | AWS: aws_elasticache_cluster | docs-aws-resource-elasticache-cluster | Provides an ElastiCache Cluster resource. |
aws_elasticache_cluster
Provides an ElastiCache Cluster resource.
Example Usage
resource "aws_elasticache_cluster" "bar" {
cluster_id = "cluster-example"
engine = "memcached"
node_type = "cache.m1.small"
port = 11211
num_cache_nodes = 1
parameter_group_name = "default.memcached1.4"
}
Argument Reference
The following arguments are supported:
-
cluster_id
– (Required) Group identifier. This parameter is stored as a lowercase string -
engine
– (Required) Name of the cache engine to be used for this cache cluster. Valid values for this parameter arememcached
orredis
-
engine_version
– (Optional) Version number of the cache engine to be used. See Selecting a Cache Engine and Version in the AWS Documentation center for supported versions -
maintenance_window
– (Optional) Specifies the weekly time range which maintenance on the cache cluster is performed. The format isddd:hh24:mi-ddd:hh24:mi
(24H Clock UTC). The minimum maintenance window is a 60 minute period. Example:sun:05:00-sun:09:00
-
node_type
– (Required) The compute and memory capacity of the nodes. See Available Cache Node Types for supported node types -
num_cache_nodes
– (Required) The initial number of cache nodes that the cache cluster will have. For Redis, this value must be 1. For Memcache, this value must be between 1 and 20 -
parameter_group_name
– (Required) Name of the parameter group to associate with this cache cluster -
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. -
subnet_group_name
– (Optional, VPC only) Name of the subnet group to be used for the cache cluster. -
security_group_names
– (Optional, EC2 Classic only) List of security group names to associate with this cache cluster -
security_group_ids
– (Optional, VPC only) One or more VPC security groups associated with the cache cluster -
apply_immediately
- (Optional) Specifies whether any database modifications are applied immediately, or during the next maintenance window. Default isfalse
. See Amazon ElastiCache Documentation for more information. (Available since v0.6.0) -
snapshot_arns
– (Optional) A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. Example:arn:aws:s3:::my_bucket/snapshot1.rdb
-
tags
- (Optional) A mapping of tags to assign to the resource.
Attributes Reference
The following attributes are exported:
-
cache_nodes
- List of node objects includingid
,address
andport
. Referenceable e.g. as${aws_elasticache_cluster.bar.cache_nodes.0.address}
-
configuration_endpoint
- (Memcached only) The configuration endpoint to allow host discovery