diff --git a/builtin/providers/aws/resource_aws_elasticache_cluster.go b/builtin/providers/aws/resource_aws_elasticache_cluster.go index fc72f3a1d4..093ea88f8c 100644 --- a/builtin/providers/aws/resource_aws_elasticache_cluster.go +++ b/builtin/providers/aws/resource_aws_elasticache_cluster.go @@ -29,6 +29,10 @@ func resourceAwsElasticacheCluster() *schema.Resource { Required: true, ForceNew: true, }, + "configuration_endpoint": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, "engine": &schema.Schema{ Type: schema.TypeString, Required: true, @@ -105,10 +109,6 @@ func resourceAwsElasticacheCluster() *schema.Resource { Type: schema.TypeInt, Computed: true, }, - "configuration_endpoint": &schema.Schema{ - Type: schema.TypeString, - Computed: true, - }, }, }, }, @@ -236,6 +236,7 @@ func resourceAwsElasticacheClusterRead(d *schema.ResourceData, meta interface{}) d.Set("engine_version", c.EngineVersion) if c.ConfigurationEndpoint != nil { d.Set("port", c.ConfigurationEndpoint.Port) + d.Set("configuration_endpoint", aws.String(fmt.Sprintf("%s:%d", *c.ConfigurationEndpoint.Address, *c.ConfigurationEndpoint.Port))) } d.Set("subnet_group_name", c.CacheSubnetGroupName) @@ -358,7 +359,6 @@ func setCacheNodeData(d *schema.ResourceData, c *elasticache.CacheCluster) error "id": *node.CacheNodeId, "address": *node.Endpoint.Address, "port": int(*node.Endpoint.Port), - "configuration_endpoint": fmt.Sprintf("%s:%d", *node.Endpoint.Address, *node.Endpoint.Port), }) } diff --git a/website/source/docs/providers/aws/r/elasticache_cluster.html.markdown b/website/source/docs/providers/aws/r/elasticache_cluster.html.markdown index 2e020a43da..2fe6a8dcf1 100644 --- a/website/source/docs/providers/aws/r/elasticache_cluster.html.markdown +++ b/website/source/docs/providers/aws/r/elasticache_cluster.html.markdown @@ -80,7 +80,9 @@ Example: `arn:aws:s3:::my_bucket/snapshot1.rdb` The following attributes are exported: -* `cache_nodes` - List of node objects including `id`, `address`, `port` and `configuration_endpoint`. +* `cache_nodes` - List of node objects including `id`, `address` and `port`. Referenceable e.g. as `${aws_elasticache_cluster.bar.cache_nodes.0.address}` + +* `configuration_endpoint` - (Memcached only) The configuration endpoint to allow host discovery [1]: http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ModifyCacheCluster.html