oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
758 stars 676 forks source link

Geting configuration error after add backend remote or cloud integration #1531

Open wagnerteixeira opened 2 years ago

wagnerteixeira commented 2 years ago

Hi! I folowing the steps of the repo https://github.com/jpetazzo/ampernetacle to create resources in oci. Runs correctly and creates everything as it should be. Also tried add a backend remote state but not work. I added the file backend.tf with the content

terraform {
  backend "remote" {
    organization = "wagner-t"

    workspaces {
      name = "kubernetes-on-arm-with-oracle"
    }
  }
}

then i receive this error:

To view this run in a browser, visit:
https://app.terraform.io/app/wagner-t/kubernetes-on-arm-with-oracle/runs/run-Avm19hKyjHUAXCdL

Waiting for the plan to start...

Terraform v1.1.5
on linux_amd64
Configuring remote state backend...
Initializing Terraform configuration...
╷
│ Error: Invalid provider configuration
│ 
│ Provider "registry.terraform.io/hashicorp/oci" requires explicit
│ configuration. Add a provider block to the root module and configure the
│ provider's required arguments as described in the provider documentation.
│ 
╵
╷
│ Error: can not create client, bad configuration: did not find a proper configuration for tenancy
│ 
│   with provider["registry.terraform.io/hashicorp/oci"],
│   on <empty> line 0:
│   (source code not available)

also tried run with cloud integration but receive the same error

Terraform Version and Provider Version

Terraform v1.1.5
on linux_amd64
+ provider registry.terraform.io/hashicorp/cloudinit v2.2.0
+ provider registry.terraform.io/hashicorp/external v2.2.0
+ provider registry.terraform.io/hashicorp/http v2.1.0
+ provider registry.terraform.io/hashicorp/local v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/oci v4.62.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/tls v3.1.0

Debug Output

https://gist.github.com/wagnerteixeira/183efa02315aeca71ff3e6b569344460

Steps to Reproduce

wsoliveira commented 2 years ago

I solved this problem removing $ rm ~/.oci/config $ rm ~/.oci/sessions/* and after run command $ oci session authenticate

der-ali commented 1 year ago

I have also the same issue

der-ali commented 1 year ago

The provider has moved to oracle/oci. Changing the source to "oracle/oci" fixed the issue for me

terraform {
  required_version = ">= 0.12.6"
  required_providers {
    oci = {
      version = ">= 4.44.0 "
      source = "oracle/oci"
    }
  }
}
ravinitp commented 1 year ago

Thank you for reporting the issue. We observed the affected resources are not provided in the description or it's incorrect. We request you to add it in issue description as mentioned in below format. Example: affected_resources = oci_core_instance , oci_core_instances

If it's not related to any particular resource then mention affected resource as terraform. Example: affected_resources = terraform

As this works through automation, request you to follow exact syntax.