Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource_aws_elasticache_replication_group: Add arn attribute #15348

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions aws/resource_aws_elasticache_replication_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -521,6 +525,16 @@ func resourceAwsElasticacheReplicationGroupRead(d *schema.ResourceData, meta int
}
}

arn := arn.ARN{
Partition: meta.(*AWSClient).partition,
Service: "elasticache",
Region: meta.(*AWSClient).region,
AccountID: meta.(*AWSClient).accountid,
Resource: fmt.Sprintf("replicationgroup:%s", d.Id()),
}.String()

d.Set("arn", arn)

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/elasticache_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,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.

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/elasticache_replication_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Cluster Mode (`cluster_mode`) supports the following:

In addition to all arguments above, the following attributes are exported:

* `arn` - The ARN of the created ElastiCache Replication Group.
* `id` - The ID of the ElastiCache Replication Group.
* `configuration_endpoint_address` - The address of the replication group configuration endpoint when cluster mode is enabled.
* `primary_endpoint_address` - (Redis only) The address of the endpoint for the primary node in the replication group, if the cluster mode is disabled.
Expand Down