Adding configuration endpoint to the elasticache cluster nodes

This commit is contained in:
stack72 2015-09-16 13:06:54 +01:00
parent 28ea44b1ff
commit 029f1fa572
2 changed files with 7 additions and 1 deletions

View File

@ -105,6 +105,10 @@ func resourceAwsElasticacheCluster() *schema.Resource {
Type: schema.TypeInt,
Computed: true,
},
"configuration_endpoint": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},
},
},
},
@ -233,6 +237,7 @@ func resourceAwsElasticacheClusterRead(d *schema.ResourceData, meta interface{})
if c.ConfigurationEndpoint != nil {
d.Set("port", c.ConfigurationEndpoint.Port)
}
d.Set("subnet_group_name", c.CacheSubnetGroupName)
d.Set("security_group_names", c.CacheSecurityGroups)
d.Set("security_group_ids", c.SecurityGroups)
@ -353,6 +358,7 @@ 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),
})
}

View File

@ -80,7 +80,7 @@ Example: `arn:aws:s3:::my_bucket/snapshot1.rdb`
The following attributes are exported:
* `cache_nodes` - List of node objects including `id`, `address` and `port`.
* `cache_nodes` - List of node objects including `id`, `address`, `port` and `configuration_endpoint`.
Referenceable e.g. as `${aws_elasticache_cluster.bar.cache_nodes.0.address}`
[1]: http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ModifyCacheCluster.html