You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/enos/modules/read_license/main.tf

42 lines
1.1 KiB

# Copyright IBM Corp. 2020, 2026
# SPDX-License-Identifier: BUSL-1.1
# Loads license from file or environment variable
# If license is null or not provided, then the license is returned from the file at license_path
variable "license_path" {
description = "Path to a boundary license file"
type = string
default = null
}
variable "license" {
description = "License key"
type = string
default = null
}
variable "edition" {
description = "Edition to determine if license is needed"
type = string
default = "oss"
validation {
condition = contains(["oss", "ent"], var.edition)
error_message = "edition must be either 'oss' or 'ent'."
}
}
check "license_or_license_path_required" {
assert {
condition = (
var.edition == "oss" ||
var.license != null ||
var.license_path != null
)
error_message = "license_path must be provided when license is not set for non-oss editions."
}
}
output "license" {
value = var.edition == "ent" ? (var.license != null ? var.license : file(var.license_path)) : ""
}