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

brokers_per_zone instead of number_of_broker_nodes #63

Conversation

joaoestrela
Copy link
Contributor

@joaoestrela joaoestrela commented Aug 16, 2022

What

  • Replace variable number_of_broker_nodes with broker_per_zone
  • Default broker_per_zone as 1
  • Validation on subnet_ids variable, should not be empty.

Why

  • instead of relying on the input being a multiple of the subnets we can calculate the number_of_broker_nodes by multiplying the desired number of brokers per zone per subnets
  • this behaviour is similar to the AWS Console UI approach (custom method) that requires the number of brokers per zone and subnets
  • number of brokers per zone is a more understandable variable than number of broker of nodes

@joaoestrela joaoestrela requested review from a team as code owners August 16, 2022 14:25
@aknysh
Copy link
Member

aknysh commented Aug 16, 2022

/test all

@joaoestrela
Copy link
Contributor Author

Sorry, didn't test it all through, feel free to run the tests in now

@aknysh
Copy link
Member

aknysh commented Aug 16, 2022

/test all

@aknysh aknysh added the major Breaking changes (or first stable release) label Aug 16, 2022
aknysh
aknysh previously requested changes Aug 16, 2022
Copy link
Member

@aknysh aknysh left a comment

Choose a reason for hiding this comment

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

@Evilong thanks for the PR

Please address https://github.com/cloudposse/actions/runs/7863863551?check_suite_focus=true

Error: Invalid value for variable
        	            	
        	            	  on main.tf line 39, in module "kafka":
        	            	  39:   subnet_ids           = module.subnets.private_subnet_ids
        	            	
        	            	The subnet_ids list must have at atleast 1 value.

we have 2 tests: when the module is enabled and disabled.
when the module is disabled, module.subnets.private_subnet_ids is an empty list, but the new validation fails b/c of that.

maybe just add

subnet_ids             = module.this.enabled ? module.subnets.private_subnet_ids : [""]

@mergify mergify bot dismissed aknysh’s stale review August 16, 2022 18:54

This Pull Request has been updated, so we're dismissing all reviews.

@joaoestrela
Copy link
Contributor Author

That might do it.
The validation is actually working as intended not allowing empty list, but since this is a test that you want to I don't see a problem with the suggested workaround.

@aknysh
Copy link
Member

aknysh commented Aug 16, 2022

/test all

@aknysh aknysh merged commit b61057e into cloudposse:master Aug 16, 2022
@joaoestrela joaoestrela deleted the brokers_per_zone_instead_of_number_of_broker_nodes branch August 16, 2022 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Breaking changes (or first stable release)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants