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

DEVOPS-2289: ElasticCache: Add single reader_endpoint_address to aws_elasticache_replication_group #1

Conversation

teorizop
Copy link

@teorizop teorizop commented Dec 10, 2019

Why do we need these changes

We had two incidents caused by ElastiCache writer instance for high network and CPU usage. By redirecting all read requests to the read-only Redis replicas, is a quick way to ease the CPU and bandwidth usage of the writer/primary node.

Fix

AWS recently added a single reader endpoint for AWS ElastiCache Redis so that we can only use a single reader endpoint to connect to your Redis read replicas:
https://aws.amazon.com/about-aws/whats-new/2019/06/amazon-elasticache-launches-reader-endpoint-for-redis/

Although, as the official Terraform Provider (for v0.11) is not supporting the single reader endpoint at the moment, we have to modify our fork of the Terraform AWS Provider to return this single reader endpoint.

Changelog

  • resource/aws_elasticache_replication_group: Add reader_endpoint_address attribute
  • data-source/aws_elasticache_replication_group: Add reader_endpoint_address attribute

Reference

On the official repo of the Terraform AWS Provider, there is an open issue regarding the above use-case.
Regarding this PR, I cherry-picked the changes from this PR (and more specifically this commit):
hashicorp#9979

The changes in this PR will let our (forked) Terraform AWS Provider to return this single endpoint (both with Terraform's resource and data definitions).

In Action

With the newly built binary of the Terraform AWS Provider, and by changing the custom JSON file with the new attribute:

...

a terraform plan will produce the following changelog (in this example we use the Argentina stack):

Output
...

So, based on the above output, it will replace the endpoints of all the reader hostnames and replace it with the single reader endpoint that AWS will take care of adding/removing endpoints in real-time.

@vmanolasBeat
Copy link

Is this still in progress?

@teorizop
Copy link
Author

teorizop commented Feb 26, 2020

Is this still in progress?

@vmanolasBeat We can close this one without merging. More info can be found on the following comment of the corresponding JIRA ticket:
<TICKET_LINK_HERE>

P.S.: @vmanolasBeat please use mentions in order to get notifications via PullPanda bot on Slack. Thanks for the reminder, Vasili!

@teorizop teorizop closed this Feb 26, 2020
@teorizop teorizop deleted the DEVOPS-2289-tf-provider-elasticache-ro-endpoint branch February 26, 2020 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants