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

allow setting single-az with multiple nodes #32

Merged
merged 7 commits into from
Apr 29, 2021

Conversation

cabrinha
Copy link

@cabrinha cabrinha commented Apr 23, 2021

what

  • I want to deploy multiple nodes into a single AZ.

why

  • I run a high throughput, low-latency service in a single AZ. I'd like more elasticache nodes in that AZ.

@cabrinha cabrinha requested review from a team as code owners April 23, 2021 17:49
@cabrinha cabrinha requested review from jamengual and srhopkins and removed request for a team April 23, 2021 17:50
Signed-off-by: Scott Cabrinha <scott@internaught.io>
@Gowiem
Copy link
Member

Gowiem commented Apr 24, 2021

/test all

Copy link
Member

@Gowiem Gowiem left a comment

Choose a reason for hiding this comment

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

One request and one question.

variables.tf Outdated Show resolved Hide resolved
@Gowiem
Copy link
Member

Gowiem commented Apr 24, 2021

@cabrinha getting the following error from our examples/complete tests:

TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: Error: error creating ElastiCache Cache Cluster: InvalidParameterCombination: Must specify the same number of preferred availability zones as requested number of nodes.
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: 	status code: 400, request id: 43fe1952-b785-4737-a754-d6c3fdc3b502
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: 
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121:   on ../../main.tf line 86, in resource "aws_elasticache_cluster" "default":
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121:   86: resource "aws_elasticache_cluster" "default" {
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: 
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: 

Please look into that and address.

@cabrinha
Copy link
Author

@cabrinha getting the following error from our examples/complete tests:

TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: Error: error creating ElastiCache Cache Cluster: InvalidParameterCombination: Must specify the same number of preferred availability zones as requested number of nodes.
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: 	status code: 400, request id: 43fe1952-b785-4737-a754-d6c3fdc3b502
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: 
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121:   on ../../main.tf line 86, in resource "aws_elasticache_cluster" "default":
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121:   86: resource "aws_elasticache_cluster" "default" {
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: 
TestExamplesComplete 2021-04-24T16:40:17Z command.go:121: 

Please look into that and address.

@Gowiem Thanks for the review. I've updated the PR, let's see if the builds go green.

@Gowiem
Copy link
Member

Gowiem commented Apr 26, 2021

/test all

@Gowiem
Copy link
Member

Gowiem commented Apr 26, 2021

@cabrinha new issue 😅

TestExamplesComplete 2021-04-26T23:18:20Z command.go:121: 
TestExamplesComplete 2021-04-26T23:18:20Z command.go:121: Error: az_mode "cross-az" is not supported with num_cache_nodes = 1
TestExamplesComplete 2021-04-26T23:18:20Z command.go:121: 
TestExamplesComplete 2021-04-26T23:18:20Z command.go:121:   on ../../main.tf line 86, in resource "aws_elasticache_cluster" "default":
TestExamplesComplete 2021-04-26T23:18:20Z command.go:121:   86: resource "aws_elasticache_cluster" "default" {
TestExamplesComplete 2021-04-26T23:18:20Z command.go:121: 
TestExamplesComplete 2021-04-26T23:18:20Z command.go:121: 
TestExamplesComplete 2021-04-26T23:18:20Z retry.go:80: Returning due to fatal error: FatalError{Underlying: exit status 1}
TestExamplesComplete 2021-04-26T23:18:20Z retry.go:72: terraform [destroy -auto-approve -input=false -lock=false -var-file fixtures.us-east-2.tfvars]

@nitrocode
Copy link
Member

Shouldn't the example's az_mode be set to single-az since that's the original default?

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_cluster#az_mode

@cabrinha
Copy link
Author

/test all

1 similar comment
@nitrocode
Copy link
Member

/test all

@Gowiem
Copy link
Member

Gowiem commented Apr 27, 2021

/test all

@Gowiem
Copy link
Member

Gowiem commented Apr 27, 2021

@cabrinha 💥

TestExamplesComplete 2021-04-27T22:57:57Z command.go:53: Running command terraform with args [apply -input=false -lock=false -auto-approve -var-file fixtures.us-east-2.tfvars]
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: Error: Reference to undeclared input variable
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121:   on main.tf line 16, in module "subnets":
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121:   16:   availability_zones   = var.availability_zones
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: An input variable with the name "availability_zones" has not been declared.
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: Did you mean "availability_zone"?
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:00Z retry.go:80: Returning due to fatal error: FatalError{Underlying: exit status 1}
TestExamplesComplete 2021-04-27T22:58:00Z retry.go:72: terraform [destroy -auto-approve -input=false -lock=false -var-file fixtures.us-east-2.tfvars]
TestExamplesComplete 2021-04-27T22:58:00Z command.go:53: Running command terraform with args [destroy -auto-approve -input=false -lock=false -var-file fixtures.us-east-2.tfvars]
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: Error: Reference to undeclared input variable
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121:   on main.tf line 16, in module "subnets":
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121:   16:   availability_zones   = var.availability_zones
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: An input variable with the name "availability_zones" has not been declared.
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: Did you mean "availability_zone"?
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:03Z retry.go:80: Returning due to fatal error: FatalError{Underlying: exit status 1}

Mind looking at that?

@cabrinha
Copy link
Author

@cabrinha 💥

TestExamplesComplete 2021-04-27T22:57:57Z command.go:53: Running command terraform with args [apply -input=false -lock=false -auto-approve -var-file fixtures.us-east-2.tfvars]
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: Error: Reference to undeclared input variable
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121:   on main.tf line 16, in module "subnets":
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121:   16:   availability_zones   = var.availability_zones
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: An input variable with the name "availability_zones" has not been declared.
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: Did you mean "availability_zone"?
TestExamplesComplete 2021-04-27T22:58:00Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:00Z retry.go:80: Returning due to fatal error: FatalError{Underlying: exit status 1}
TestExamplesComplete 2021-04-27T22:58:00Z retry.go:72: terraform [destroy -auto-approve -input=false -lock=false -var-file fixtures.us-east-2.tfvars]
TestExamplesComplete 2021-04-27T22:58:00Z command.go:53: Running command terraform with args [destroy -auto-approve -input=false -lock=false -var-file fixtures.us-east-2.tfvars]
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: Error: Reference to undeclared input variable
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121:   on main.tf line 16, in module "subnets":
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121:   16:   availability_zones   = var.availability_zones
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: An input variable with the name "availability_zones" has not been declared.
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: Did you mean "availability_zone"?
TestExamplesComplete 2021-04-27T22:58:03Z command.go:121: 
TestExamplesComplete 2021-04-27T22:58:03Z retry.go:80: Returning due to fatal error: FatalError{Underlying: exit status 1}

Mind looking at that?

Yeah, just pushed another commit. Looks like I renamed the var when I should have just added a new one.

@Gowiem
Copy link
Member

Gowiem commented Apr 27, 2021

/test all

@cabrinha
Copy link
Author

/test all

Terratest was expecting two subnets to be returned, but I changed the example to be single-az, so I updated the test to expect a single AZ.

@Gowiem
Copy link
Member

Gowiem commented Apr 28, 2021

/test all

@cabrinha
Copy link
Author

cabrinha commented Apr 28, 2021

Looks like we're good here. Anything else I need to do before merge? @Gowiem

@Gowiem Gowiem merged commit 1c30cd3 into cloudposse:master Apr 29, 2021
@Gowiem
Copy link
Member

Gowiem commented Apr 29, 2021

Thanks for the contribution @cabrinha! Released as 0.12.0.

@cabrinha cabrinha deleted the az-mode branch April 30, 2021 16:49
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.

4 participants