Hi ,
I am encountering an issue where, whenever I run terraform apply
or terraform plan
, I receive the following error:
│ Error: GET https://api./api/v2/organizations/me giving up after 21 attempt(s): Get "https://api./api/v2/organizations/me": dial tcp: lookup api.: no such host
│
│ with provider["registry.terraform.io/mypurecloud/genesyscloud"],
│ on main.tf line 22, in provider "genesyscloud":
│ 22: provider "genesyscloud" {
│
╵
Releasing state lock. This may take a few moments...
I have tried adding this block to my main.tf
, but the problem still remains:
Null resource to execute a custom API call using curl to bypass Terraform's API issues
resource "null_resource" "custom_api_call" {
provisioner "local-exec" {
environment = {
PURECLOUD_ENVIRONMENT = "mypurecloud.ie" # Explicitly setting the environment variable
}
# Hardcoded access token for the curl command
command = "curl -X GET https://api.mypurecloud.ie/api/v2/organizations/me -H "Authorization: Bearer 2yNORk5Q1F#################################################################""
}
triggers = {
always_run = "${timestamp()}" # Ensures this runs every time Terraform is applied
}
}
Due to this specific error, I cannot use terraform plan
or terraform apply
. I would appreciate your assistance.