Skip to content
This repository was archived by the owner on Nov 14, 2020. It is now read-only.
This repository was archived by the owner on Nov 14, 2020. It is now read-only.

help with support for version terraform v0.13.x upgrade from v0.12.x #194

Open
@miketwenty1

Description

@miketwenty1

Hi there,

I'm wondering if there is an issue with this terraform provider with the new version of 0.13.4
I'm unable to figure out how to upgrade/replace the old hashicorp provider that was used in v12.

error with terraform init

Initializing provider plugins...
- terraform.io/builtin/terraform is built in to Terraform
- Using previously-installed hashicorp/template v2.2.0
- Using previously-installed hashicorp/aws v3.11.0
- Using previously-installed terraform-providers/postgresql v1.7.1
- Finding latest version of hashicorp/postgresql...

Error: Failed to install providers

Could not find required providers, but found possible alternatives:

  hashicorp/postgresql -> terraform-providers/postgresql

If these suggestions look correct, upgrade your configuration with the
following command:

The following remote modules must also be upgraded for Terraform 0.13
compatibility:
- module.<some value> at
git::git@git<some value>

One thing to note is the "following command" is blank this seems like a bug.
It seems like the output is telling me to use this new provider from hashicorp/postgresql -> terraform-providers/postgresql

The provider terraform config: (trying to comply with v13 requirements).

provider "postgresql" {
  host              = <some value>
  port              = <some value>
  username          = <some value>
  password          = <some value>
  expected_version  = <some value>
  connect_timeout   = <some value>
  sslmode           = <some value>
}

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
    }
    postgresql = {
      source  = "terraform-providers/postgresql"
    }
  }

  required_version = ">= 0.13"
}

This will sucessfully add the new provider terraform-providers/postgresql to my terraform providers

terraform providers

├── provider[registry.terraform.io/hashicorp/aws]
└── <some module.repo>
    ├── provider[registry.terraform.io/hashicorp/aws]
    ├── provider[registry.terraform.io/terraform-providers/postgresql]
    ├── provider[registry.terraform.io/hashicorp/postgresql]
    ├── provider[terraform.io/builtin/terraform]
    ├── provider[registry.terraform.io/hashicorp/template]

As you can see from this output it
Here is an example of how I'm using the postgresql provider:

Example resources:
resource "postgresql_database" "service" {
  name = var.service_name
}

resource "postgresql_extension" "my_extension" {
  database  = var.service_name
  name      = "pg_transport"

  depends_on = [postgresql_database.service]
}

removing these resources will make the terraform providers command remove the provider[registry.terraform.io/hashicorp/postgresql] .. adding these resources will add it back. It seems to not want to use the given suggested provider.

Please let me know what I'm doing wrong thanks so much.

Edit:
Also note running terraform 0.13upgrade did add a version.tf but didn't fix the issue and didn't add the terraform-providers/postgresql I have above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions