ContainerSolutions / terraform-examples

Simple and idiomatic examples of various Terraform functions and features.
https://containersolutions.github.io/terraform-examples/
159 stars 51 forks source link

Update terraform to 1.0.0 #46

Closed sanyer closed 3 years ago

teszes commented 3 years ago

Can you elaborate on what this would entail?

ttarczynski commented 3 years ago

I would assume that to make this update we need to:

  1. Set the required terraform version to ">= 1.0.0" in all examples
    terraform {
    required_version = ">= 1.0.0"
    }
  2. Change CI definitions to use Terraform >= 1.0.0
    • https://github.com/ContainerSolutions/terraform-examples/blob/main/.github/workflows/main.yml
    • here for tflint:
      - name: Terraform Validate
      uses: terraform-linters/setup-tflint@v1
      with:
        tflint_version: v0.28.0 # Must be specified. See: https://github.com/terraform-linters/tflint/releases for latest versions
    • Providers* CI jobs uses the Terraform version included in the ubuntu-latest runner:
      ProvidersAWS:
      concurrency: provider_test_aws
      needs: [TFLint, TFValidate, Checks]
      runs-on: ubuntu-latest
      steps:
      - name: Check out repository code
      uses: actions/checkout@v2
      with:
        fetch-depth: 0   # Need whole history, or at least far enough back to get .test_log.log reference
      - name: Setup TFLint
      uses: terraform-linters/setup-tflint@v1
      - name: Inject slug/short variables
      uses: rlespinasse/github-slug-action@v3.x
      - name: Run AWS examples
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        CI_USE_TF_CLOUD: true
        TERRAFORM_CLOUD_LOGIN_TOKEN: ${{ secrets.TERRAFORM_CLOUD_LOGIN_TOKEN }}
      if: github.ref == 'refs/heads/main' || env.GITHUB_REF_SLUG == 'integration' # Only run on main/integration, as these take a long time
      run: ${{ github.workspace }}/bin/run_aws_examples.sh

Docs: