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

Update Terraform versions which are tested against #592

Merged
merged 6 commits into from
Mar 11, 2021
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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: ["0.12.29", "0.13.4", "0.14.0"]
terraform: ["0.13.6", "0.14.7", "0.15.0-beta1"]
container:
image: docker.mirror.hashicorp.services/hashicorp/jsii-terraform
env:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
- name: create bundle
run: yarn package
- name: Upload dist
if: ${{ matrix.terraform == '0.12.29' }}
if: ${{ matrix.terraform == '0.14.7' }}
uses: actions/upload-artifact@v2
with:
name: dist
Expand All @@ -55,7 +55,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: ["0.12.29", "0.13.4", "0.14.0"]
terraform: ["0.13.6", "0.14.7", "0.15.0-beta1"]
target: ["typescript", "python", "java", "csharp"]
container:
image: docker.mirror.hashicorp.services/hashicorp/jsii-terraform
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
terraform: ["0.12.29", "0.13.4", "0.14.0"]
terraform: ["0.13.6", "0.14.7", "0.15.0-beta1"]
target: ["typescript", "python", "java", "csharp"]
needs: build
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
terraform: ["0.14.0"]
terraform: ["0.14.7"]
target: ["python", "csharp", "java", "typescript"]
container:
image: docker.mirror.hashicorp.services/hashicorp/jsii-terraform
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV DEFAULT_TERRAFORM_VERSION=0.14.7 \
MAVEN_OPTS="-Xms256m -Xmx3G"

# Install Terraform
RUN AVAILABLE_TERRAFORM_VERSIONS="0.12.29 0.13.0 0.13.4 0.13.6 0.14.0 ${DEFAULT_TERRAFORM_VERSION} 0.15.0-beta1" && \
RUN AVAILABLE_TERRAFORM_VERSIONS="0.13.6 ${DEFAULT_TERRAFORM_VERSION} 0.15.0-beta1" && \
for VERSION in ${AVAILABLE_TERRAFORM_VERSIONS}; do curl -LOk https://releases.hashicorp.com/terraform/${VERSION}/terraform_${VERSION}_linux_amd64.zip && \
mkdir -p /usr/local/bin/tf/versions/${VERSION} && \
unzip terraform_${VERSION}_linux_amd64.zip -d /usr/local/bin/tf/versions/${VERSION} && \
Expand Down
7 changes: 3 additions & 4 deletions packages/cdktf-cli/bin/cmds/terraform-check.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TerraformCli } from './ui/models/terraform-cli'
import * as semver from 'semver';

const MIN_SUPPORTED_VERSION = '0.12.0'
const MIN_SUPPORTED_VERSION = '0.13.0'
const VERSION_REGEXP = /Terraform v\d+.\d+.\d+/

export const terraformCheck = async (): Promise<void> => {
Expand All @@ -17,9 +17,8 @@ export const terraformCheck = async (): Promise<void> => {
const cleanTerraformVersion = semver.clean(terraformVersionMatches[0].substring(terraformVersionMatches[0].indexOf('v')))

if (cleanTerraformVersion && semver.lt(cleanTerraformVersion, MIN_SUPPORTED_VERSION)) {
const errorMessage = `Error: unsupported Terraform version [${cleanTerraformVersion}] - please upgrade to >=${MIN_SUPPORTED_VERSION}`
console.error(errorMessage)
process.exit(1)
const warningMessage = `Warning: unsupported Terraform version [${cleanTerraformVersion}] - please upgrade to >=${MIN_SUPPORTED_VERSION}`
console.warn(warningMessage)
}
}
} catch(e) {
Expand Down