Merge pull request #3250 from stack72/aws-elasticache-configuration_endpoint

Adding configuration endpoint to the elasticache cluster nodes
This commit is contained in:
Paul Hinze 2015-09-17 14:27:10 -05:00
commit 028e50bae6
2 changed files with 8 additions and 0 deletions

View File

@ -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,
@ -232,7 +236,9 @@ 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)
d.Set("security_group_names", c.CacheSecurityGroups)
d.Set("security_group_ids", c.SecurityGroups)

View File

@ -82,5 +82,7 @@ The following attributes are exported:
* `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