Commit cb853573 authored by Stephen Coe's avatar Stephen Coe Committed by Erik Osterman

Input variable for replication_group_id (#28)

* adding an input variable for replication_group_id

* fix formatting

* updating docs
parent eb3a647e
<!-- This file was automatically generated by the `build-harness`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. --> <!-- This file was automatically generated by the `build-harness`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. -->
[![README Header][readme_header_img]][readme_header_link]
[![Cloud Posse][logo]](https://cpco.io/homepage)
[![Cloud Posse](https://cloudposse.com/logo-300x69.svg)](https://cloudposse.com)
# terraform-aws-elasticache-redis [![Build Status](https://travis-ci.org/cloudposse/terraform-aws-elasticache-redis.svg?branch=master)](https://travis-ci.org/cloudposse/terraform-aws-elasticache-redis) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-elasticache-redis.svg)](https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com) # terraform-aws-elasticache-redis [![Build Status](https://travis-ci.org/cloudposse/terraform-aws-elasticache-redis.svg?branch=master)](https://travis-ci.org/cloudposse/terraform-aws-elasticache-redis) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-aws-elasticache-redis.svg)](https://github.com/cloudposse/terraform-aws-elastic-beanstalk-environment/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
...@@ -11,7 +11,17 @@ Terraform module to provision an [`ElastiCache`](https://aws.amazon.com/elastica ...@@ -11,7 +11,17 @@ Terraform module to provision an [`ElastiCache`](https://aws.amazon.com/elastica
--- ---
This project is part of our comprehensive ["SweetOps"](https://docs.cloudposse.com) approach towards DevOps. This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
[<img align="right" title="Share via Email" src="https://docs.cloudposse.com/images/ionicons/ios-email-outline-2.0.1-16x16-999999.svg"/>][share_email]
[<img align="right" title="Share on Google+" src="https://docs.cloudposse.com/images/ionicons/social-googleplus-outline-2.0.1-16x16-999999.svg" />][share_googleplus]
[<img align="right" title="Share on Facebook" src="https://docs.cloudposse.com/images/ionicons/social-facebook-outline-2.0.1-16x16-999999.svg" />][share_facebook]
[<img align="right" title="Share on Reddit" src="https://docs.cloudposse.com/images/ionicons/social-reddit-outline-2.0.1-16x16-999999.svg" />][share_reddit]
[<img align="right" title="Share on LinkedIn" src="https://docs.cloudposse.com/images/ionicons/social-linkedin-outline-2.0.1-16x16-999999.svg" />][share_linkedin]
[<img align="right" title="Share on Twitter" src="https://docs.cloudposse.com/images/ionicons/social-twitter-outline-2.0.1-16x16-999999.svg" />][share_twitter]
[![Terraform Open Source Modules](https://docs.cloudposse.com/images/terraform-open-source-modules.svg)][terraform_modules]
It's 100% Open Source and licensed under the [APACHE2](LICENSE). It's 100% Open Source and licensed under the [APACHE2](LICENSE).
...@@ -22,6 +32,11 @@ It's 100% Open Source and licensed under the [APACHE2](LICENSE). ...@@ -22,6 +32,11 @@ It's 100% Open Source and licensed under the [APACHE2](LICENSE).
We literally have [*hundreds of terraform modules*][terraform_modules] that are Open Source and well-maintained. Check them out!
...@@ -109,6 +124,7 @@ Available targets: ...@@ -109,6 +124,7 @@ Available targets:
| notification_topic_arn | Notification topic arn | string | `` | no | | notification_topic_arn | Notification topic arn | string | `` | no |
| parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | list | `<list>` | no | | parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | list | `<list>` | no |
| port | Redis port | string | `6379` | no | | port | Redis port | string | `6379` | no |
| replication_group_id | Replication group ID with the following constraints: A name must contain from 1 to 20 alphanumeric characters or hyphens. The first character must be a letter. A name cannot end with a hyphen or contain two consecutive hyphens. | string | `` | no |
| security_groups | AWS security group ids | list | `<list>` | no | | security_groups | AWS security group ids | list | `<list>` | no |
| stage | Stage | string | `default` | no | | stage | Stage | string | `default` | no |
| subnets | AWS subnet ids | list | `<list>` | no | | subnets | AWS subnet ids | list | `<list>` | no |
...@@ -135,26 +151,38 @@ Available targets: ...@@ -135,26 +151,38 @@ Available targets:
File a GitHub [issue](https://github.com/cloudposse/terraform-aws-elasticache-redis/issues), send us an [email][email] or join our [Slack Community][slack]. File a GitHub [issue](https://github.com/cloudposse/terraform-aws-elasticache-redis/issues), send us an [email][email] or join our [Slack Community][slack].
[![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link]
## Commercial Support ## Commercial Support
Work directly with our team of DevOps experts via email, slack, and video conferencing. Work directly with our team of DevOps experts via email, slack, and video conferencing.
We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer. We provide [*commercial support*][commercial_support] for all of our [Open Source][github] projects. As a *Dedicated Support* customer, you have access to our team of subject matter experts at a fraction of the cost of a full-time engineer.
[![E-Mail](https://img.shields.io/badge/email-hello@cloudposse.com-blue.svg)](mailto:hello@cloudposse.com) [![E-Mail](https://img.shields.io/badge/email-hello@cloudposse.com-blue.svg)][email]
- **Questions.** We'll use a Shared Slack channel between your team and ours. - **Questions.** We'll use a Shared Slack channel between your team and ours.
- **Troubleshooting.** We'll help you triage why things aren't working. - **Troubleshooting.** We'll help you triage why things aren't working.
- **Code Reviews.** We'll review your Pull Requests and provide constructive feedback. - **Code Reviews.** We'll review your Pull Requests and provide constructive feedback.
- **Bug Fixes.** We'll rapidly work to fix any bugs in our projects. - **Bug Fixes.** We'll rapidly work to fix any bugs in our projects.
- **Build New Terraform Modules.** We'll develop original modules to provision infrastructure. - **Build New Terraform Modules.** We'll [develop original modules][module_development] to provision infrastructure.
- **Cloud Architecture.** We'll assist with your cloud strategy and design. - **Cloud Architecture.** We'll assist with your cloud strategy and design.
- **Implementation.** We'll provide hands-on support to implement our reference architectures. - **Implementation.** We'll provide hands-on support to implement our reference architectures.
## Community Forum
Get access to our [Open Source Community Forum][slack] on Slack. It's **FREE** to join for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build *sweet* infrastructure. ## Terraform Module Development
Are you interested in custom Terraform module development? Submit your inquiry using [our form][module_development] today and we'll get back to you ASAP.
## Slack Community
Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
## Newsletter
Signup for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
## Contributing ## Contributing
...@@ -164,7 +192,7 @@ Please use the [issue tracker](https://github.com/cloudposse/terraform-aws-elast ...@@ -164,7 +192,7 @@ Please use the [issue tracker](https://github.com/cloudposse/terraform-aws-elast
### Developing ### Developing
If you are interested in being a contributor and want to get involved in developing this project or [help out](https://github.com/orgs/cloudposse/projects/3) with our other projects, we would love to hear from you! Shoot us an [email](mailto:hello@cloudposse.com). If you are interested in being a contributor and want to get involved in developing this project or [help out](https://cpco.io/help-out) with our other projects, we would love to hear from you! Shoot us an [email][email].
In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
...@@ -179,7 +207,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow. ...@@ -179,7 +207,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
## Copyright ## Copyright
Copyright © 2017-2018 [Cloud Posse, LLC](https://cloudposse.com) Copyright © 2017-2018 [Cloud Posse, LLC](https://cpco.io/copyright)
...@@ -220,26 +248,16 @@ All other trademarks referenced herein are the property of their respective owne ...@@ -220,26 +248,16 @@ All other trademarks referenced herein are the property of their respective owne
## About ## About
This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know at <hello@cloudposse.com> This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know by [leaving a testimonial][testimonial]!
[![Cloud Posse](https://cloudposse.com/logo-300x69.svg)](https://cloudposse.com) [![Cloud Posse][logo]][website]
We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We love [Open Source Software](https://github.com/cloudposse/)! We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We ❤️ [Open Source Software][we_love_open_source].
We offer paid support on all of our projects. We offer [paid support][commercial_support] on all of our projects.
Check out [our other projects][github], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation. Check out [our other projects][github], [follow us on twitter][twitter], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation.
[docs]: https://docs.cloudposse.com/
[website]: https://cloudposse.com/
[github]: https://github.com/cloudposse/
[commercial_support]: https://github.com/orgs/cloudposse/projects
[jobs]: https://cloudposse.com/jobs/
[hire]: https://cloudposse.com/contact/
[slack]: https://slack.cloudposse.com/
[linkedin]: https://www.linkedin.com/company/cloudposse
[twitter]: https://twitter.com/cloudposse/
[email]: mailto:hello@cloudposse.com
### Contributors ### Contributors
...@@ -261,3 +279,36 @@ Check out [our other projects][github], [apply for a job][jobs], or [hire us][hi ...@@ -261,3 +279,36 @@ Check out [our other projects][github], [apply for a job][jobs], or [hire us][hi
[christopherriley_avatar]: https://github.com/christopherriley.png?size=150 [christopherriley_avatar]: https://github.com/christopherriley.png?size=150
[![README Footer][readme_footer_img]][readme_footer_link]
[![Beacon][beacon]][website]
[logo]: https://cloudposse.com/logo-300x69.svg
[docs]: https://cpco.io/docs
[website]: https://cpco.io/homepage
[github]: https://cpco.io/github
[jobs]: https://cpco.io/jobs
[hire]: https://cpco.io/hire
[slack]: https://cpco.io/slack
[linkedin]: https://cpco.io/linkedin
[twitter]: https://cpco.io/twitter
[testimonial]: https://cpco.io/leave-testimonial
[newsletter]: https://cpco.io/newsletter
[email]: https://cpco.io/email
[commercial_support]: https://cpco.io/commercial-support
[we_love_open_source]: https://cpco.io/we-love-open-source
[module_development]: https://cpco.io/module-development
[terraform_modules]: https://cpco.io/terraform-modules
[readme_header_img]: https://cloudposse.com/readme/header/img?repo=cloudposse/terraform-aws-elasticache-redis
[readme_header_link]: https://cloudposse.com/readme/header/link?repo=cloudposse/terraform-aws-elasticache-redis
[readme_footer_img]: https://cloudposse.com/readme/footer/img?repo=cloudposse/terraform-aws-elasticache-redis
[readme_footer_link]: https://cloudposse.com/readme/footer/link?repo=cloudposse/terraform-aws-elasticache-redis
[readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img?repo=cloudposse/terraform-aws-elasticache-redis
[readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?repo=cloudposse/terraform-aws-elasticache-redis
[share_twitter]: https://twitter.com/intent/tweet/?text=terraform-aws-elasticache-redis&url=https://github.com/cloudposse/terraform-aws-elasticache-redis
[share_linkedin]: https://www.linkedin.com/shareArticle?mini=true&title=terraform-aws-elasticache-redis&url=https://github.com/cloudposse/terraform-aws-elasticache-redis
[share_reddit]: https://reddit.com/submit/?url=https://github.com/cloudposse/terraform-aws-elasticache-redis
[share_facebook]: https://facebook.com/sharer/sharer.php?u=https://github.com/cloudposse/terraform-aws-elasticache-redis
[share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/terraform-aws-elasticache-redis
[share_email]: mailto:?subject=terraform-aws-elasticache-redis&body=https://github.com/cloudposse/terraform-aws-elasticache-redis
[beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-aws-elasticache-redis?pixel&cs=github&cm=readme&an=terraform-aws-elasticache-redis
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
| notification_topic_arn | Notification topic arn | string | `` | no | | notification_topic_arn | Notification topic arn | string | `` | no |
| parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | list | `<list>` | no | | parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | list | `<list>` | no |
| port | Redis port | string | `6379` | no | | port | Redis port | string | `6379` | no |
| replication_group_id | Replication group ID with the following constraints: A name must contain from 1 to 20 alphanumeric characters or hyphens. The first character must be a letter. A name cannot end with a hyphen or contain two consecutive hyphens. | string | `` | no |
| security_groups | AWS security group ids | list | `<list>` | no | | security_groups | AWS security group ids | list | `<list>` | no |
| stage | Stage | string | `default` | no | | stage | Stage | string | `default` | no |
| subnets | AWS subnet ids | list | `<list>` | no | | subnets | AWS subnet ids | list | `<list>` | no |
......
...@@ -52,7 +52,7 @@ resource "aws_elasticache_replication_group" "default" { ...@@ -52,7 +52,7 @@ resource "aws_elasticache_replication_group" "default" {
count = "${var.enabled == "true" ? 1 : 0}" count = "${var.enabled == "true" ? 1 : 0}"
auth_token = "${var.auth_token}" auth_token = "${var.auth_token}"
replication_group_id = "${module.label.id}" replication_group_id = "${var.replication_group_id == "" ? module.label.id : var.replication_group_id}"
replication_group_description = "${module.label.id}" replication_group_description = "${module.label.id}"
node_type = "${var.instance_type}" node_type = "${var.instance_type}"
number_cache_clusters = "${var.cluster_size}" number_cache_clusters = "${var.cluster_size}"
......
...@@ -147,3 +147,9 @@ variable "auth_token" { ...@@ -147,3 +147,9 @@ variable "auth_token" {
description = "Auth token for password protecting redis, transit_encryption_enabled must be set to 'true'! Password must be longer than 16 chars" description = "Auth token for password protecting redis, transit_encryption_enabled must be set to 'true'! Password must be longer than 16 chars"
default = "" default = ""
} }
variable "replication_group_id" {
type = "string"
description = "Replication group ID with the following constraints: \nA name must contain from 1 to 20 alphanumeric characters or hyphens. \n The first character must be a letter. \n A name cannot end with a hyphen or contain two consecutive hyphens."
default = ""
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment