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

Make "active-active" a valid production_type value #249

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
locals {
# TFE Architecture
# ----------------
# Determine whether or not TFE in active-active mode based on node count, by default standalone is assumed
active_active = var.vm_node_count >= 2 ? true : false
disk_mode = var.production_type == "disk" ? true : false
active_active = var.vm_node_count >= 2 || var.production_type == "active-active"
disk_mode = var.production_type == "disk"

# Network
# -------
Expand Down
10 changes: 3 additions & 7 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -916,16 +916,12 @@ variable "tls_version" {
variable "production_type" {
default = null
type = string
description = "Where Terraform Enterprise application data will be stored. Valid values are `external`, `disk`, or `null`. Choose `external` when storing application data in an external object storage service and database. Choose `disk` when storing application data in a directory on the Terraform Enterprise instance itself. Leave it `null` when you want Terraform Enterprise to use its own default."
description = "Where Terraform Enterprise application data will be stored. Valid values are `external`, `disk`, `active-active` or `null`. Choose `external` when storing application data in an external object storage service and database. Choose `disk` when storing application data in a directory on the Terraform Enterprise instance itself. Chose `active-active` when deploying more than 1 node. Leave it `null` when you want Terraform Enterprise to use its own default."

validation {
condition = (
var.production_type == "external" ||
var.production_type == "disk" ||
var.production_type == null
)
condition = contains(["external", "disk", "active-active", null], var.production_type)
Copy link
Contributor

Choose a reason for hiding this comment

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

💭 Would it not be even cleaner if we were to start requiring the operational mode and remove the logic with the node_count influencing the operational mode?

Also, while we are here, please do rename it to operational_mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to avoid introducing breaking changes with this PR. Renaming it to operational_mode will break all of the existing deployments relying on this module.

Part of the cons of having the module public, and non-versioned 🤷🏼


error_message = "The production_type must be 'external', 'disk', or omitted."
error_message = "The production_type must be 'external', 'disk', `active-active` or omitted."
}
}

Expand Down
Loading