We cannot paste keys with actual new lines in Terraform Cloud, so we must use \n.
Actual Behavior
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: can not create client, bad configuration: did not find a proper configuration for private key
│
│ with provider["registry.terraform.io/oracle/oci"].oci-home,
│ on main.tf line 19, in provider "oci":
│ 19: provider "oci" {
│
╵
╷
│ Error: can not create client, bad configuration: did not find a proper configuration for private key
│
│ with provider["registry.terraform.io/oracle/oci"],
│ on main.tf line 24, in provider "oci":
│ 24: provider "oci" {
│
╵
Steps to Reproduce
Export all of the necessary variables for the OCI provider:
TF_VAR_user_ocid
TF_VAR_fingerprint
TF_VAR_tenancy_ocid
TF_VAR_private_key
Run Terraform Plan
You will encounter an auth error
Important Factoids
I tested provider changes locally to fix this issue.
Community Note
Terraform Version and Provider Version
Terraform v1.7.5 on linux_amd64
provider registry.terraform.io/hashicorp/time v0.11.2 provider registry.terraform.io/oracle/oci v6.10.0
Affected Resource(s)
affected_resources = terraform
Terraform Configuration Files
Debug Output
https://gist.github.com/Tmanoche/4641860c452e6794f040bfbc4851c637
Panic Output
Expected Behavior
We should be able to use an example private key format in our TF_VAR_private_key:
We cannot paste keys with actual new lines in Terraform Cloud, so we must use \n.
Actual Behavior
Planning failed. Terraform encountered an error while generating this plan.
Steps to Reproduce
Export all of the necessary variables for the OCI provider: TF_VAR_user_ocid TF_VAR_fingerprint TF_VAR_tenancy_ocid TF_VAR_private_key
Run Terraform Plan
You will encounter an auth error
Important Factoids
I tested provider changes locally to fix this issue.
I changed these lines: https://github.com/oracle/terraform-provider-oci/blob/master/internal/provider/provider.go#L553-L555
To:
References