hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.77k stars 9.12k forks source link

primary endpoint attribute missing in aws_elasticache_cluster resource - redis engine. #20394

Open evairmarinho opened 3 years ago

evairmarinho commented 3 years ago

Community Note

Description

After creating an ElastiCache Redis cluster, I need the primary_endpoint attribute to be exported. It would be equivalent to CloudFormation's RedisEndpoint.Address. Link: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticache-cache-cluster.html

Motivation

Actually, i need to configure in automated way the loki addon in Kubernetes cluster with Terraform. I need configure redis in cache_config block: https://grafana.com/docs/loki/latest/configuration/#cache_config . One of the required parameters is the redis endpoint.

New or Affected Resource(s)

aws_elasticache_cluster

Potential Terraform Configuration

Attributes reference

primary_endpoint - (Redis Only) The DNS address of the configuration endpoint for the Redis cache cluster.

resource "aws_elasticache_cluster" "this" {
 cluster_id           = "cluster-example"
 engine               = "redis"
## configurations...

}

output "redis_primary_endpoint" {
description = "The DNS address of the configuration endpoint for the Redis cache cluster."
value = aws_elasticache_cluster.this.primary_endpoint
}

References

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticache-cache-cluster.html https://docs.aws.amazon.com/sdk-for-go/api/service/elasticache/#Endpoint

evairmarinho commented 3 years ago

@anGie44 @gdavison

evairmarinho commented 3 years ago

@chrisclayson

github-actions[bot] commented 2 weeks ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

aiell0 commented 6 days ago

Re-opening this as I also would like to have this for some Crossplane automation I'd like to do. I will look into submitting a PR for it shortly.