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

Updating validation blocking single-AZ ES clusters when Zone Awareness is disabled #159

Closed
wants to merge 2 commits into from

Conversation

jacob-hudson
Copy link

what

Removing errant validation preventing the creation of Amazon OpenSearch Service ElasticSearch (ES) or OpenSearch (OS) clusters which live in a single Available Zone on Amazon Web Services (AWS)

Simple Process:

  • You merge this PR
  • You release a new version
  • We can create clusters which live in one AZ
  • Everyone wins

why

Development and testing clusters may not want or need two or more Availability Zones for cost (among other reasons, but FinOps - saving money - is important)

references

#158

Identical errors in internal company environment

@jacob-hudson jacob-hudson requested review from a team as code owners April 19, 2023 17:49
@jacob-hudson jacob-hudson changed the title removing validating blocking single-AZ ES clusters removing validation blocking single-AZ ES clusters Apr 19, 2023
@milldr
Copy link
Member

milldr commented Apr 19, 2023

valid values for zone_awareness_config are only 2 and 3 for the Terraform resource. Why remove that check?

@jacob-hudson
Copy link
Author

jacob-hudson commented Apr 19, 2023

valid values for zone_awareness_config are only 2 and 3 for the Terraform resource. Why remove that check?

You guys do not pin module versions to TF versions, meaning we could need the latest module (eg for EBS GP3) and not care about which aws provider version

Maybe remove the check and let AWS respond with an error a la GraphQL?

Copy link
Contributor

@Nuru Nuru left a comment

Choose a reason for hiding this comment

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

This seems unnecessary to me. I would need to see added testing before I would approve this.

Users should be able to set zone_awareness_enabled to false and leave availability_zone_count unset and defaulted to 2, or set to 2 if the configuration of the root module makes leaving it unset too difficult.

@Nuru Nuru added the do not merge Do not merge this PR, doing so would cause problems label Apr 19, 2023
@jacob-hudson
Copy link
Author

This seems unnecessary to me. I would need to see added testing before I would approve this.

Users should be able to set zone_awareness_enabled to false and leave availability_zone_count unset and defaulted to 2, or set to 2 if the configuration of the root module makes leaving it unset too difficult.

Working on this, give me a few

@jacob-hudson jacob-hudson changed the title removing validation blocking single-AZ ES clusters Updating validation blocking single-AZ ES clusters when Zone Awareness is disabled Apr 19, 2023
@jacob-hudson
Copy link
Author

Interesting point:

Would there ever be a chance you would want Zone Awareness disabled with more than 1 AZ?

@@ -124,8 +124,8 @@ variable "availability_zone_count" {
description = "Number of Availability Zones for the domain to use."

validation {
condition = contains([2, 3], var.availability_zone_count)
error_message = "The availibility zone count must be 2 or 3."
condition = contains([2, 3], var.availability_zone_count) && var.zone_awareness_enabled == "true"
Copy link
Contributor

Choose a reason for hiding this comment

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

INVALID TERRAFORM: Variable validation conditions can refer only to the containing variable.

@Nuru Nuru added the invalid This doesn't seem right label Apr 20, 2023
@ManuelMueller1st
Copy link

Can't we add 1 as a valid count? This seems unnecessarily complex to me.

@jacob-hudson jacob-hudson closed this by deleting the head repository Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Do not merge this PR, doing so would cause problems invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants