diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index f4b3b25..9556f85 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -14,7 +14,7 @@ jobs: id: fmt run: terraform fmt -check -recursive -diff -no-color continue-on-error: true - - uses: actions/github-script@0.9.0 + - uses: actions/github-script@v3 if: steps.fmt.outputs.exitcode != 0 with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -47,7 +47,7 @@ jobs: run: terraform init -no-color working-directory: examples/hcloud-k3s continue-on-error: true - - uses: actions/github-script@0.9.0 + - uses: actions/github-script@v3 if: steps.init.outputs.exitcode != 0 with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -72,7 +72,7 @@ jobs: run: terraform validate -no-color working-directory: examples/hcloud-k3s continue-on-error: true - - uses: actions/github-script@0.9.0 + - uses: actions/github-script@v3 if: steps.validate.outputs.exitcode != 0 env: STDOUT: "terraform\n${{ steps.validate.outputs.stdout }}" @@ -101,7 +101,7 @@ jobs: run: terraform plan -input=false -no-color working-directory: examples/hcloud-k3s continue-on-error: true - - uses: actions/github-script@0.9.0 + - uses: actions/github-script@v3 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | diff --git a/examples/hcloud-k3s/versions.tf b/examples/hcloud-k3s/versions.tf new file mode 100644 index 0000000..6b7fa28 --- /dev/null +++ b/examples/hcloud-k3s/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + hcloud = { + source = "terraform-providers/hcloud" + } + } + required_version = ">= 0.13" +} diff --git a/version.tf b/k3s_version.tf similarity index 100% rename from version.tf rename to k3s_version.tf diff --git a/main.tf b/main.tf index 3eae103..f9d3e7f 100644 --- a/main.tf +++ b/main.tf @@ -1,13 +1,3 @@ -terraform { - required_version = "~> 0.12" - experiments = [variable_validation] - required_providers { - http = "~> 1.2" - null = "~> 2.1" - random = "~> 2.2" - } -} - // Generate the k3s token used by all nodes to join the cluster resource "random_password" "k3s_cluster_secret" { length = 48 diff --git a/versions.tf b/versions.tf new file mode 100644 index 0000000..f2cd671 --- /dev/null +++ b/versions.tf @@ -0,0 +1,17 @@ +terraform { + required_providers { + http = { + source = "hashicorp/http" + version = "~> 1.2" + } + null = { + source = "hashicorp/null" + version = "~> 2.1" + } + random = { + source = "hashicorp/random" + version = "~> 2.2" + } + } + required_version = ">= 0.13" +}