I am running terraform script which will provision the Oracle DBS in OCI
when I run terraform plan
I'm getting below error
Source code:
data "oci_identity_availability_domains" "ADs" { compartment_id = var.tenancy_ocid }
Help me to solve this issue
I am running terraform script which will provision the Oracle DBS in OCI
when I run terraform plan
I'm getting below error
Source code:
data "oci_identity_availability_domains" "ADs" { compartment_id = var.tenancy_ocid }
Help me to solve this issue
The \r is not supposed to be there in the url.
You probably have a newline in our terraform script. I would remove it and try again.
Windows uses both \r (CR for Carriage Return) and \n (LF for Linefeed) for a new line while Unix/Linux only uses \n. So if you can't remove the new line, you can make sure that it is compatible for Unix environment. Most text editors allow to convert/choose the new line character.
I was able to run this sample: `
variable "tenancy_ocid" {}
variable "user_ocid" {}
variable "fingerprint" {}
variable "private_key_path" {}
variable "region" {}
variable "compartment_ocid" {}
provider "oci" {
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
region = var.region
}
data "oci_identity_availability_domains" "ads" {
compartment_id = var.tenancy_ocid
}
output "ads" {
value = data.oci_identity_availability_domains.ads.availability_domains
}
data "oci_identity_availability_domain" "ad" {
compartment_id = var.tenancy_ocid
ad_number = 2
}
I ran this on provider version: 4.44.0 and using 12.31 Terraform version.
I found the answer, the problem is that I had setup the region in Environment Variables, I have used source env_var.txt command to set the environment variables, it included \r (Carriage Return) at the end of the line.
So just set the Environment variables using export TF_VAR_region="us-ashburn-1" command