rootlyhq/terraform-provider-rootly

`provider.tf` is incorrectly generated causing failure to initialize terraform.

Closed this issue · 2 comments

Terraform Version

1.5.7

Expected Behavior

terraformer rootly generates proper provider.tf files. For example:

terraform {
  required_version = ">= 0.13.1"
  
  required_providers {
    rootly = {
      source = "rootlyhq/rootly"
      version = "1.2.17"
    }
  }
}

provider "rootly" {
  # Configuration options
}

Actual Behavior

You will encounter this error when you initialize the any workspace generated by terraformer

terraform init

Initializing the backend...
╷
│ Error: Invalid legacy provider address
│
│ This configuration or its associated state refers to the unqualified provider "rootly".
│
│ You must complete the Terraform 0.13 upgrade process before upgrading to later versions.
╵

This is the file that is generated:

terraform {
	required_providers {
		rootly = {
	    version = "~> 1.2.17"
		}
  }
}

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:
Run Rootly terraformer and look at the resulting providers.tf generated.

Important Factoids

The work around is to first generate the terraform with terraformer, then manually update the providers.tf and then update the state with:

terraform state replace-provider -auto-approve "registry.terraform.io/-/rootly" "rootlyhq/rootly"                                                                                                                                                           SRE-3207
Terraform will perform the following actions:

  ~ Updating provider:
    - registry.terraform.io/-/rootly
    + registry.terraform.io/rootlyhq/rootly

Changing 432 resources:
...

The latest version of Rootly's terraformer will output correct provider.tf files. .tfstate files are still output with older TF schema, requiring terraform state replace-provider -auto-approve "registry.terraform.io/-/rootly" "rootlyhq/rootly" to upgrade it to TF 0.13+

I will keep this issue open until that is resolved.

moved to terraformer repo: rootlyhq/terraformer#4