0

I am passing my code this way in the main.tf where am creating the private datafusion instance.

# CDAP namespace block 

data "google_client_config" "current" {}
provider "cdap" {
  host  = google_data_fusion_instance.instance.api_endpoint
  token = data.google_client_config.current.access_token
}

resource "cdap_namespace" "namespace" {
  name = var.cdap_name
}

resource "cdap_namespace_preferences" "preferences" { 
  namespace   = cdap_namespace.namespace.name
  preferences = var.cdap_preferences
}

While the pipeline is running, it is getting failed when it is trying to create a namespace "Error 401 Unauthorised"

PS: Using service account to create the datafusion instance have got the datafusion.admin roles applied. Do u think we need to add more roles? or Is it the way am passing the access token?

..........................

Pooja
  • 1
  • 1
  • More on the issue, It is not actually while creating the cdap namespace but in general the url is not getting accessed. No luck so far – Pooja Jul 12 '23 at 16:51
  • 401 usually means that the request is missing the authorization header. Are you running terraform outside a GCP VM? If so, you may need to run `gcloud auth application-default login`. See https://stackoverflow.com/questions/76464964/error-401-unauthorised-when-creating-cdap-namesapce-via-terraform-access-token – Arjan Singh Bal Aug 18 '23 at 19:04

0 Answers0