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

Elasticache Memcached az_mode requires ForceNew #1758

Merged
merged 1 commit into from
Oct 11, 2017

Conversation

s-maj
Copy link
Contributor

@s-maj s-maj commented Sep 27, 2017

Fixes: #726

Due to some AWS API quirkiness, it's best to set up memcached like this:

resource "aws_elasticache_cluster" "memcached" {
  cluster_id             = "${format("%.16s-%.3s", lower(var.name), random_id.token.hex)}"
  (...)
  az_mode                = "${var.nodes_number == 1 ? "single-az" : "cross-az"}"
  engine                 = "memcached"
}

otherwise it might be hard to scale down cluster. Or just stick with single-az if needed.

=== RUN   TestAccAWSElasticacheCluster_basic
--- PASS: TestAccAWSElasticacheCluster_basic (499.00s)
=== RUN   TestAccAWSElasticacheCluster_snapshotsWithUpdates
--- PASS: TestAccAWSElasticacheCluster_snapshotsWithUpdates (1059.79s)
=== RUN   TestAccAWSElasticacheCluster_decreasingCacheNodes
--- PASS: TestAccAWSElasticacheCluster_decreasingCacheNodes (1137.61s)
=== RUN   TestAccAWSElasticacheCluster_multiAZInVpc
--- PASS: TestAccAWSElasticacheCluster_multiAZInVpc (676.54s)s
=== RUN   TestAccAWSElasticacheCluster_vpc
--- PASS: TestAccAWSElasticacheCluster_vpc (600.21s)

@s-maj s-maj changed the title [WIP] Elasticache Memcached az_mode does not require ForceNew Elasticache Memcached az_mode requires ForceNew Sep 27, 2017
@radeksimko radeksimko added enhancement Requests to existing resources that expand the functionality or scope. bug Addresses a defect in current functionality. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Sep 27, 2017
@radeksimko radeksimko self-assigned this Oct 11, 2017
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we had ForceNewWhen so we could express this appropriately in the schema, but we don't so relying on the server/API side validation seems like a sensible way to do this. 👍

I can confirm that the API does the validation and returns error when trying to scale down:

* aws_elasticache_cluster.bar: [WARN] Error updating ElastiCache cluster (cluster-example), error: InvalidParameterCombination: Can only specify new availability zones or AZ mode when adding cache nodes.
	status code: 400, request id: 67ecf258-ae83-11e7-b63a-c3f6fd37683f

Thanks for the PR.

@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memcache Cluster: Adding a new node in a new AZ forces new resources
2 participants