diff --git a/builtin/providers/aws/resource_aws_elasticache_replication_group.go b/builtin/providers/aws/resource_aws_elasticache_replication_group.go index 588d0c6ab..317d37d9e 100644 --- a/builtin/providers/aws/resource_aws_elasticache_replication_group.go +++ b/builtin/providers/aws/resource_aws_elasticache_replication_group.go @@ -42,6 +42,11 @@ func resourceAwsElasticacheReplicationGroup() *schema.Resource { ForceNew: true, } + resourceSchema["primary_endpoint_address"] = &schema.Schema{ + Type: schema.TypeString, + Computed: true, + } + resourceSchema["engine"].Required = false resourceSchema["engine"].Optional = true resourceSchema["engine"].Default = "redis" @@ -215,6 +220,8 @@ func resourceAwsElasticacheReplicationGroupRead(d *schema.ResourceData, meta int d.Set("snapshot_window", c.SnapshotWindow) d.Set("snapshot_retention_limit", c.SnapshotRetentionLimit) + d.Set("primary_endpoint_address", rgp.NodeGroups[0].PrimaryEndpoint.Address) + } return nil diff --git a/website/source/docs/providers/aws/r/elasticache_replication_group.html.markdown b/website/source/docs/providers/aws/r/elasticache_replication_group.html.markdown index 89d147201..e986d89a5 100644 --- a/website/source/docs/providers/aws/r/elasticache_replication_group.html.markdown +++ b/website/source/docs/providers/aws/r/elasticache_replication_group.html.markdown @@ -31,7 +31,7 @@ resource "aws_elasticache_replication_group" "bar" { The following arguments are supported: -* `replication_group_id` – (Required) The replication group identifier. This parameter is stored as a lowercase string. +* `replication_group_id` – (Required) The replication group identifier. * `replication_group_description` – (Required) A user-created description for the replication group. * `number_cache_clusters` - (Required) The number of cache clusters this replication group will have. If Multi-AZ is enabled , the value of this parameter must be at least 2. Changing this number will force a new resource @@ -66,4 +66,5 @@ Please note that setting a `snapshot_retention_limit` is not supported on cache. The following attributes are exported: -* `id` - The ID of the ElastiCache Replication Group \ No newline at end of file +* `id` - The ID of the ElastiCache Replication Group +* `primary_endpoint_address` - The Address of the Primary Node in the replication group. Doesn't include the port. \ No newline at end of file