Adopt Terraform v0.12 templatefile function

* Update terraform-render-bootstrap module to adopt the
Terrform v0.12 templatefile function feature to replace
the use of terraform-provider-template's `template_dir`
* Require Terraform v0.12.6+ which adds `for_each`

Background:

* `template_dir` was added to `terraform-provider-template`
to add support for template directory rendering in CoreOS
Tectonic Kubernetes distribution (~2017)
* Terraform v0.12 introduced a native `templatefile` function
and v0.12.6 introduced native `for_each` support (July 2019)
that makes it possible to replace `template_dir` usage
This commit is contained in:
Dalton Hubble 2019-11-13 14:09:34 -08:00
parent ad117f4592
commit cb0598e275
15 changed files with 17 additions and 14 deletions

View File

@ -4,6 +4,9 @@ Notable changes between versions.
## Latest ## Latest
* Require Terraform version v0.12.6+ (action required)
* Replace internal usage of `template_dir` with `templatefile` function
## v1.16.3 ## v1.16.3
* Kubernetes [v1.16.3](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.16.md#v1163) * Kubernetes [v1.16.3](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.16.md#v1163)

View File

@ -1,6 +1,6 @@
# Kubernetes assets (kubeconfig, manifests) # Kubernetes assets (kubeconfig, manifests)
module "bootstrap" { module "bootstrap" {
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=0daa1276c633fea28e41b2c2c18831e2584deb24" source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=1bba891d95b143866614c928f87026e4c79f2eae"
cluster_name = var.cluster_name cluster_name = var.cluster_name
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)] api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]

View File

@ -1,7 +1,7 @@
# Terraform version and plugin versions # Terraform version and plugin versions
terraform { terraform {
required_version = "~> 0.12.0" required_version = "~> 0.12.6"
required_providers { required_providers {
aws = "~> 2.23" aws = "~> 2.23"
ct = "~> 0.3" ct = "~> 0.3"

View File

@ -1,6 +1,6 @@
# Kubernetes assets (kubeconfig, manifests) # Kubernetes assets (kubeconfig, manifests)
module "bootstrap" { module "bootstrap" {
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=0daa1276c633fea28e41b2c2c18831e2584deb24" source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=1bba891d95b143866614c928f87026e4c79f2eae"
cluster_name = var.cluster_name cluster_name = var.cluster_name
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)] api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]

View File

@ -1,7 +1,7 @@
# Terraform version and plugin versions # Terraform version and plugin versions
terraform { terraform {
required_version = "~> 0.12.0" required_version = "~> 0.12.6"
required_providers { required_providers {
aws = "~> 2.23" aws = "~> 2.23"
ct = "~> 0.4" ct = "~> 0.4"

View File

@ -1,6 +1,6 @@
# Kubernetes assets (kubeconfig, manifests) # Kubernetes assets (kubeconfig, manifests)
module "bootstrap" { module "bootstrap" {
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=0daa1276c633fea28e41b2c2c18831e2584deb24" source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=1bba891d95b143866614c928f87026e4c79f2eae"
cluster_name = var.cluster_name cluster_name = var.cluster_name
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)] api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]

View File

@ -1,7 +1,7 @@
# Terraform version and plugin versions # Terraform version and plugin versions
terraform { terraform {
required_version = "~> 0.12.0" required_version = "~> 0.12.6"
required_providers { required_providers {
azurerm = "~> 1.27" azurerm = "~> 1.27"
ct = "~> 0.3" ct = "~> 0.3"

View File

@ -1,6 +1,6 @@
# Kubernetes assets (kubeconfig, manifests) # Kubernetes assets (kubeconfig, manifests)
module "bootstrap" { module "bootstrap" {
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=0daa1276c633fea28e41b2c2c18831e2584deb24" source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=1bba891d95b143866614c928f87026e4c79f2eae"
cluster_name = var.cluster_name cluster_name = var.cluster_name
api_servers = [var.k8s_domain_name] api_servers = [var.k8s_domain_name]

View File

@ -1,7 +1,7 @@
# Terraform version and plugin versions # Terraform version and plugin versions
terraform { terraform {
required_version = "~> 0.12.0" required_version = "~> 0.12.6"
required_providers { required_providers {
matchbox = "~> 0.3.0" matchbox = "~> 0.3.0"
ct = "~> 0.3" ct = "~> 0.3"

View File

@ -1,6 +1,6 @@
# Kubernetes assets (kubeconfig, manifests) # Kubernetes assets (kubeconfig, manifests)
module "bootstrap" { module "bootstrap" {
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=0daa1276c633fea28e41b2c2c18831e2584deb24" source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=1bba891d95b143866614c928f87026e4c79f2eae"
cluster_name = var.cluster_name cluster_name = var.cluster_name
api_servers = [var.k8s_domain_name] api_servers = [var.k8s_domain_name]

View File

@ -1,7 +1,7 @@
# Terraform version and plugin versions # Terraform version and plugin versions
terraform { terraform {
required_version = "~> 0.12.0" required_version = "~> 0.12.6"
required_providers { required_providers {
matchbox = "~> 0.3.0" matchbox = "~> 0.3.0"
ct = "~> 0.4" ct = "~> 0.4"

View File

@ -1,6 +1,6 @@
# Kubernetes assets (kubeconfig, manifests) # Kubernetes assets (kubeconfig, manifests)
module "bootstrap" { module "bootstrap" {
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=0daa1276c633fea28e41b2c2c18831e2584deb24" source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=1bba891d95b143866614c928f87026e4c79f2eae"
cluster_name = var.cluster_name cluster_name = var.cluster_name
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)] api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]

View File

@ -1,7 +1,7 @@
# Terraform version and plugin versions # Terraform version and plugin versions
terraform { terraform {
required_version = "~> 0.12.0" required_version = "~> 0.12.6"
required_providers { required_providers {
digitalocean = "~> 1.3" digitalocean = "~> 1.3"
ct = "~> 0.3" ct = "~> 0.3"

View File

@ -1,6 +1,6 @@
# Kubernetes assets (kubeconfig, manifests) # Kubernetes assets (kubeconfig, manifests)
module "bootstrap" { module "bootstrap" {
source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=0daa1276c633fea28e41b2c2c18831e2584deb24" source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=1bba891d95b143866614c928f87026e4c79f2eae"
cluster_name = var.cluster_name cluster_name = var.cluster_name
api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)] api_servers = [format("%s.%s", var.cluster_name, var.dns_zone)]

View File

@ -1,7 +1,7 @@
# Terraform version and plugin versions # Terraform version and plugin versions
terraform { terraform {
required_version = "~> 0.12.0" required_version = "~> 0.12.6"
required_providers { required_providers {
google = "~> 2.5" google = "~> 2.5"
ct = "~> 0.3" ct = "~> 0.3"