Commit 2025cb66 authored by Sam Sullivan's avatar Sam Sullivan Committed by GitHub

Fix creation of Redis in cluster mode (#65)

* No number_cache_clusters if cluster_mode_enabled

See https://github.com/cloudposse/terraform-aws-elasticache-redis/issues/64

* No explicit AZs in cluster mode

* Updated README.md
Co-authored-by: default avataractions-bot <58130806+actions-bot@users.noreply.github.com>
parent 9904a81c
...@@ -256,6 +256,10 @@ We deliver 10x the value for a fraction of the cost of a full-time engineer. Our ...@@ -256,6 +256,10 @@ We deliver 10x the value for a fraction of the cost of a full-time engineer. Our
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. 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.
## Discourse Forums
Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account.
## Newsletter ## Newsletter
Sign up 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. Sign up 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.
...@@ -375,6 +379,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply ...@@ -375,6 +379,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=testimonial [testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=testimonial
[office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=office_hours [office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=office_hours
[newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=newsletter [newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=newsletter
[discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=discourse
[email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=email [email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=email
[commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=commercial_support [commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=commercial_support
[we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=we_love_open_source [we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-elasticache-redis&utm_content=we_love_open_source
......
...@@ -85,10 +85,10 @@ resource "aws_elasticache_replication_group" "default" { ...@@ -85,10 +85,10 @@ resource "aws_elasticache_replication_group" "default" {
replication_group_id = var.replication_group_id == "" ? module.label.id : var.replication_group_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_mode_enabled ? (1 + var.cluster_mode_replicas_per_node_group) * var.cluster_mode_num_node_groups : var.cluster_size number_cache_clusters = var.cluster_mode_enabled ? null : var.cluster_size
port = var.port port = var.port
parameter_group_name = join("", aws_elasticache_parameter_group.default.*.name) parameter_group_name = join("", aws_elasticache_parameter_group.default.*.name)
availability_zones = slice(var.availability_zones, 0, var.cluster_size) availability_zones = var.cluster_mode_enabled ? null : slice(var.availability_zones, 0, var.cluster_size)
automatic_failover_enabled = var.automatic_failover_enabled automatic_failover_enabled = var.automatic_failover_enabled
subnet_group_name = local.elasticache_subnet_group_name subnet_group_name = local.elasticache_subnet_group_name
security_group_ids = var.use_existing_security_groups ? var.existing_security_groups : [join("", aws_security_group.default.*.id)] security_group_ids = var.use_existing_security_groups ? var.existing_security_groups : [join("", aws_security_group.default.*.id)]
......
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