diff --git a/aws/data_source_aws_elasticache_replication_group.go b/aws/data_source_aws_elasticache_replication_group.go index 2cc8a21a47e3..1880a52ad6e2 100644 --- a/aws/data_source_aws_elasticache_replication_group.go +++ b/aws/data_source_aws_elasticache_replication_group.go @@ -21,6 +21,10 @@ func dataSourceAwsElasticacheReplicationGroup() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "auth_token_enabled": { Type: schema.TypeBool, Computed: true, @@ -95,6 +99,7 @@ func dataSourceAwsElasticacheReplicationGroupRead(d *schema.ResourceData, meta i d.SetId(aws.StringValue(rg.ReplicationGroupId)) d.Set("replication_group_description", rg.Description) + d.Set("arn", rg.ARN) d.Set("auth_token_enabled", rg.AuthTokenEnabled) if rg.AutomaticFailover != nil { switch aws.StringValue(rg.AutomaticFailover) { diff --git a/aws/data_source_aws_elasticache_replication_group_test.go b/aws/data_source_aws_elasticache_replication_group_test.go index 5e04cb7d75b1..5a4726745d51 100644 --- a/aws/data_source_aws_elasticache_replication_group_test.go +++ b/aws/data_source_aws_elasticache_replication_group_test.go @@ -22,6 +22,7 @@ func TestAccDataSourceAwsElasticacheReplicationGroup_basic(t *testing.T) { Config: testAccDataSourceAwsElasticacheReplicationGroupConfig_basic(rName), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(dataSourceName, "auth_token_enabled", "false"), + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), resource.TestCheckResourceAttrPair(dataSourceName, "automatic_failover_enabled", resourceName, "automatic_failover_enabled"), resource.TestCheckResourceAttrPair(dataSourceName, "member_clusters.#", resourceName, "member_clusters.#"), resource.TestCheckResourceAttrPair(dataSourceName, "node_type", resourceName, "node_type"), diff --git a/aws/resource_aws_elasticache_replication_group.go b/aws/resource_aws_elasticache_replication_group.go index 1281ebab505c..4ec2da537c4b 100644 --- a/aws/resource_aws_elasticache_replication_group.go +++ b/aws/resource_aws_elasticache_replication_group.go @@ -34,6 +34,10 @@ func resourceAwsElasticacheReplicationGroup() *schema.Resource { Optional: true, Computed: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "at_rest_encryption_enabled": { Type: schema.TypeBool, Optional: true, @@ -458,6 +462,7 @@ func resourceAwsElasticacheReplicationGroupRead(d *schema.ResourceData, meta int } d.Set("cluster_enabled", rgp.ClusterEnabled) d.Set("replication_group_id", rgp.ReplicationGroupId) + d.Set("arn", rgp.ARN) if rgp.NodeGroups != nil { if len(rgp.NodeGroups[0].NodeGroupMembers) == 0 { diff --git a/aws/resource_aws_elasticache_replication_group_test.go b/aws/resource_aws_elasticache_replication_group_test.go index 4d710f0a5fad..59d623616e22 100644 --- a/aws/resource_aws_elasticache_replication_group_test.go +++ b/aws/resource_aws_elasticache_replication_group_test.go @@ -71,6 +71,7 @@ func TestAccAWSElasticacheReplicationGroup_basic(t *testing.T) { Config: testAccAWSElasticacheReplicationGroupConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "elasticache", fmt.Sprintf("replicationgroup:%s", rName)), resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), resource.TestCheckResourceAttr(resourceName, "member_clusters.#", "2"), resource.TestCheckResourceAttr(resourceName, "auto_minor_version_upgrade", "false"), diff --git a/website/docs/d/elasticache_replication_group.html.markdown b/website/docs/d/elasticache_replication_group.html.markdown index 85edc90efb83..f820b2511b05 100644 --- a/website/docs/d/elasticache_replication_group.html.markdown +++ b/website/docs/d/elasticache_replication_group.html.markdown @@ -28,8 +28,8 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: -* `replication_group_id` - The identifier for the replication group. * `replication_group_description` - The description of the replication group. +* `arn` - The Amazon Resource Name (ARN) of the created ElastiCache Replication Group. * `auth_token_enabled` - A flag that enables using an AuthToken (password) when issuing Redis commands. * `automatic_failover_enabled` - A flag whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. * `node_type` – The cluster node type. diff --git a/website/docs/r/elasticache_cluster.html.markdown b/website/docs/r/elasticache_cluster.html.markdown index 6d482909a1d1..1fdfb49847f7 100644 --- a/website/docs/r/elasticache_cluster.html.markdown +++ b/website/docs/r/elasticache_cluster.html.markdown @@ -140,9 +140,9 @@ SNS topic to send ElastiCache notifications to. Example: In addition to all arguments above, the following attributes are exported: +* `arn` - The ARN of the created ElastiCache Cluster. * `cache_nodes` - List of node objects including `id`, `address`, `port` and `availability_zone`. Referenceable e.g. as `${aws_elasticache_cluster.bar.cache_nodes.0.address}` - * `configuration_endpoint` - (Memcached only) The configuration endpoint to allow host discovery. * `cluster_address` - (Memcached only) The DNS name of the cache cluster without the port appended. diff --git a/website/docs/r/elasticache_replication_group.html.markdown b/website/docs/r/elasticache_replication_group.html.markdown index 2c30f954f4d4..9aa04cf0c142 100644 --- a/website/docs/r/elasticache_replication_group.html.markdown +++ b/website/docs/r/elasticache_replication_group.html.markdown @@ -149,6 +149,7 @@ Cluster Mode (`cluster_mode`) supports the following: In addition to all arguments above, the following attributes are exported: +* `arn` - The Amazon Resource Name (ARN) of the created ElastiCache Replication Group. * `id` - The ID of the ElastiCache Replication Group. * `cluster_enabled` - Indicates if cluster mode is enabled. * `configuration_endpoint_address` - The address of the replication group configuration endpoint when cluster mode is enabled.