Merge branch 'A-Gordon-aws_elasticache_cluster_address'

This commit is contained in:
stack72 2016-09-20 17:30:42 +01:00
commit 25ae6d2555
No known key found for this signature in database
GPG Key ID: 8619A619B085CB16
2 changed files with 8 additions and 0 deletions

View File

@ -170,6 +170,11 @@ func resourceAwsElasticacheCluster() *schema.Resource {
Computed: true,
}
resourceSchema["cluster_address"] = &schema.Schema{
Type: schema.TypeString,
Computed: true,
}
resourceSchema["replication_group_id"] = &schema.Schema{
Type: schema.TypeString,
Computed: true,
@ -348,6 +353,7 @@ func resourceAwsElasticacheClusterRead(d *schema.ResourceData, meta interface{})
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("cluster_address", aws.String(fmt.Sprintf("%s", *c.ConfigurationEndpoint.Address)))
}
if c.ReplicationGroupId != nil {

View File

@ -27,6 +27,8 @@ func TestAccAWSElasticacheCluster_basic(t *testing.T) {
testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.bar", &ec),
resource.TestCheckResourceAttr(
"aws_elasticache_cluster.bar", "cache_nodes.0.id", "0001"),
resource.TestCheckResourceAttrSet("aws_elasticache_cluster.bar", "configuration_endpoint"),
resource.TestCheckResourceAttrSet("aws_elasticache_cluster.bar", "cluster_address"),
),
},
},