Add Terraform v0.13 input variable validations

* Support for migrating from Terraform v0.12.x to v0.13.x
was added in v1.18.8
* Require Terraform v0.13+. Drop support for Terraform v0.12
This commit is contained in:
Dalton Hubble
2020-11-17 11:30:01 -08:00
parent 5c3b5a20de
commit cc00afa4e1
27 changed files with 82 additions and 19 deletions

View File

@ -43,8 +43,13 @@ variable "worker_type" {
variable "os_stream" {
type = string
description = "Fedora CoreOs image stream for instances (e.g. stable, testing, next)"
description = "Fedora CoreOS image stream for instances (e.g. stable, testing, next)"
default = "stable"
validation {
condition = contains(["stable", "testing", "next"], var.os_stream)
error_message = "The os_stream must be stable, testing, or next."
}
}
variable "disk_size" {
@ -159,6 +164,11 @@ variable "arch" {
type = string
description = "Container architecture (amd64 or arm64)"
default = "amd64"
validation {
condition = var.arch == "amd64" || var.arch == "arm64"
error_message = "The arch must be amd64 or arm64."
}
}
variable "daemonset_tolerations" {

View File

@ -1,7 +1,7 @@
# Terraform version and plugin versions
terraform {
required_version = ">= 0.12.26, < 0.14.0"
required_version = "~> 0.13.0"
required_providers {
aws = ">= 2.23, <= 4.0"
template = "~> 2.1"

View File

@ -36,8 +36,13 @@ variable "instance_type" {
variable "os_stream" {
type = string
description = "Fedora CoreOs image stream for instances (e.g. stable, testing, next)"
description = "Fedora CoreOS image stream for instances (e.g. stable, testing, next)"
default = "stable"
validation {
condition = contains(["stable", "testing", "next"], var.os_stream)
error_message = "The os_stream must be stable, testing, or next."
}
}
variable "disk_size" {
@ -121,4 +126,9 @@ variable "arch" {
type = string
description = "Container architecture (amd64 or arm64)"
default = "amd64"
validation {
condition = var.arch == "amd64" || var.arch == "arm64"
error_message = "The arch must be amd64 or arm64."
}
}

View File

@ -1,7 +1,7 @@
# Terraform version and plugin versions
terraform {
required_version = ">= 0.12.26, < 0.14.0"
required_version = "~> 0.13.0"
required_providers {
aws = ">= 2.23, <= 4.0"
template = "~> 2.1"