Differences between revisions 2 and 3
Revision 2 as of 2022-05-17 04:09:57
Size: 1050
Editor: PieterSmit
Comment:
Revision 3 as of 2022-05-17 04:36:41
Size: 1292
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 28: Line 28:
 ##Upgrade
Line 29: Line 30:
 ##Fix provider in state
 $ tg state replace-provider "registry.terraform.io/-/aws" "hashicorp/aws"
Line 35: Line 39:

 5. :( fix more errors {{{
This configuration or its associated state refers to the unqualified
│ provider "aws".
}}}

Cloud/Terraform/UpgradeFrom0.13

  • Older Terraform state files need a upgrade (format change) going past version 0.13.0

Steps

  1. Update terraform version to v0.13.7
  2. State apply to test all is still good, fixing errors :(

    • Error

      Initializing the backend...
      Error: error configuring S3 Backend: no valid credential sources for S3 Backend found.
      Please see https://www.terraform.io/docs/backends/types/s3.html
      for more information about providing credentials.
      Error: NoCredentialProviders: no valid providers in chain. Deprecated.
              For verbose messaging see aws.Config.CredentialsChainVerboseErrors
      ERRO[0009] 1 error occurred:
              * exit status 1
      • Fix: Can't use sso, with old version set env vars.

        export AWS_ACCESS_KEY_ID="AS...FB"
        export AWS_SECRET_ACCESS_KEY="PR...di"
        export AWS_SESSION_TOKEN="IQoJb......xJ/"
  3. Run upgrade

     $ tfswitch 0.13.7
     ##Upgrade
     $ tg init && tg 0.13upgrade
     ##Fix provider in state
     $ tg state replace-provider "registry.terraform.io/-/aws" "hashicorp/aws"
  4. Test newer version

     $ tfswitch 1.1.9
     $ tg init && tg plan
  5. :( fix more errors

    This configuration or its associated state refers to the unqualified
    │ provider "aws".

Cloud/Terraform/UpgradeFrom0.13 (last edited 2022-05-17 04:36:41 by PieterSmit)