github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/aws/r/elasticache_cluster.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_elasticache_cluster"
     4  sidebar_current: "docs-aws-resource-elasticache-cluster"
     5  description: |-
     6    Provides an ElastiCache Cluster resource.
     7  ---
     8  
     9  # aws\_elasticache\_cluster
    10  
    11  Provides an ElastiCache Cluster resource.
    12  
    13  Changes to a Cache Cluster can occur when you manually change a
    14  parameter, such as `node_type`, and are reflected in the next maintenance
    15  window. Because of this, Terraform may report a difference in its planning
    16  phase because a modification has not yet taken place. You can use the
    17  `apply_immediately` flag to instruct the service to apply the change immediately
    18  (see documentation below).
    19  
    20  ~> **Note:** using `apply_immediately` can result in a
    21  brief downtime as the server reboots. See the AWS Docs on
    22  [Modifying an ElastiCache Cache Cluster][2] for more information.
    23  
    24  ## Example Usage
    25  
    26  ```hcl
    27  resource "aws_elasticache_cluster" "bar" {
    28    cluster_id           = "cluster-example"
    29    engine               = "memcached"
    30    node_type            = "cache.t2.micro"
    31    port                 = 11211
    32    num_cache_nodes      = 1
    33    parameter_group_name = "default.memcached1.4"
    34  }
    35  ```
    36  
    37  ## Argument Reference
    38  
    39  The following arguments are supported:
    40  
    41  * `cluster_id` – (Required) Group identifier. ElastiCache converts
    42    this name to lowercase
    43  
    44  * `engine` – (Required) Name of the cache engine to be used for this cache cluster.
    45   Valid values for this parameter are `memcached` or `redis`
    46  
    47  * `engine_version` – (Optional) Version number of the cache engine to be used.
    48  See [Selecting a Cache Engine and Version](https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/SelectEngine.html)
    49  in the AWS Documentation center for supported versions
    50  
    51  * `maintenance_window` – (Optional) Specifies the weekly time range for when maintenance
    52  on the cache cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi` (24H Clock UTC).
    53  The minimum maintenance window is a 60 minute period. Example: `sun:05:00-sun:09:00`
    54  
    55  * `node_type` – (Required) The compute and memory capacity of the nodes. See
    56  [Available Cache Node Types](https://aws.amazon.com/elasticache/details#Available_Cache_Node_Types) for
    57  supported node types
    58  
    59  * `num_cache_nodes` – (Required) The initial number of cache nodes that the
    60  cache cluster will have. For Redis, this value must be 1. For Memcache, this
    61  value must be between 1 and 20. If this number is reduced on subsequent runs,
    62  the highest numbered nodes will be removed.
    63  
    64  * `parameter_group_name` – (Required) Name of the parameter group to associate
    65  with this cache cluster
    66  
    67  * `port` – (Required) The port number on which each of the cache nodes will
    68  accept connections. For Memcache the default is 11211, and for Redis the default port is 6379.
    69  
    70  * `subnet_group_name` – (Optional, VPC only) Name of the subnet group to be used
    71  for the cache cluster.
    72  
    73  * `security_group_names` – (Optional, EC2 Classic only) List of security group
    74  names to associate with this cache cluster
    75  
    76  * `security_group_ids` – (Optional, VPC only) One or more VPC security groups associated
    77   with the cache cluster
    78  
    79  * `apply_immediately` - (Optional) Specifies whether any database modifications
    80       are applied immediately, or during the next maintenance window. Default is
    81       `false`. See [Amazon ElastiCache Documentation for more information.][1]
    82       (Available since v0.6.0)
    83  
    84  * `snapshot_arns` – (Optional) A single-element string list containing an
    85  Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3.
    86  Example: `arn:aws:s3:::my_bucket/snapshot1.rdb`
    87  
    88  * `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.
    89  
    90  * `snapshot_window` - (Optional, Redis only) The daily time range (in UTC) during which ElastiCache will
    91  begin taking a daily snapshot of your cache cluster. Example: 05:00-09:00
    92  
    93  * `snapshot_retention_limit` - (Optional, Redis only) The number of days for which ElastiCache will
    94  retain automatic cache cluster snapshots before deleting them. For example, if you set
    95  SnapshotRetentionLimit to 5, then a snapshot that was taken today will be retained for 5 days
    96  before being deleted. If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off.
    97  Please note that setting a `snapshot_retention_limit` is not supported on cache.t1.micro or cache.t2.* cache nodes
    98  
    99  * `notification_topic_arn` – (Optional) An Amazon Resource Name (ARN) of an
   100  SNS topic to send ElastiCache notifications to. Example:
   101  `arn:aws:sns:us-east-1:012345678999:my_sns_topic`
   102  
   103  * `az_mode` - (Optional, Memcached only) Specifies whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are `single-az` or `cross-az`, default is `single-az`. If you want to choose `cross-az`, `num_cache_nodes` must be greater than `1`
   104  
   105  * `availability_zone` - (Optional) The Availability Zone for the cache cluster. If you want to create cache nodes in multi-az, use `availability_zones`
   106  
   107  * `availability_zones` - (Optional, Memcached only) List of Availability Zones in which the cache nodes will be created. If you want to create cache nodes in single-az, use `availability_zone`
   108  
   109  * `tags` - (Optional) A mapping of tags to assign to the resource
   110  
   111  ~> **NOTE:** Snapshotting functionality is not compatible with t2 instance types.
   112  
   113  ## Attributes Reference
   114  
   115  The following attributes are exported:
   116  
   117  * `cache_nodes` - List of node objects including `id`, `address`, `port` and `availability_zone`.
   118     Referenceable e.g. as `${aws_elasticache_cluster.bar.cache_nodes.0.address}`
   119  
   120  * `configuration_endpoint` - (Memcached only) The configuration endpoint to allow host discovery.
   121  * `cluster_address` - (Memcached only) The DNS name of the cache cluster without the port appended.
   122  
   123  [1]: https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ModifyCacheCluster.html
   124  [2]: https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/Clusters.Modify.html
   125  
   126  
   127  ## Import
   128  
   129  ElastiCache Clusters can be imported using the `cluster_id`, e.g.
   130  
   131  ```
   132  $ terraform import aws_elasticache_cluster.my_cluster my_cluster
   133  ```