'Terraform Datafusion deployment issues
i am hoping someone can assist me with this. I am trying to spin up a datafusion instance in terraform/terragrunt and i am using the google_data_fusion_instance module. To my knowledge it is all configured correctly but when i push with cloudbuild it eventually fails in our step 2 with the following error:
Step #2: Error: Error creating Instance: googleapi: Error 400: Malformed name: 'projects/gc-t-prj-poc-0001-5473/locations/europe-west2/instances/'
Step #2: Details:
Step #2: [
Step #2: {
Step #2: "@type": "type.googleapis.com/google.rpc.BadRequest",
Step #2: "fieldViolations": [
Step #2: {
Step #2: "description": "URL path has empty component",
Step #2: "field": "projects/gc-t-prj-poc-0001-5473/locations/europe-west2/instances/"
Step #2: }
Step #2: ]
Step #2: }
Step #2: ]
I cannot seem to find anything on this error online at all so it's hard for me to diagnose my code when i have no idea which area seems to have an issue, or if im simply just missing some extra lines here and there.
Here is my terragrunt.hcl for it
terraform {
source = "../../../../modules//data_fusion/"
}
# Include all settings from the root terragrunt.hcl file
include {
path = find_in_parent_folders("org.hcl")
}
dependency "project" {
config_path = "../"
# Configure mock outputs for the terraform commands that are returned when there are no outputs available (e.g the
# module hasn't been applied yet.
mock_outputs_allowed_terraform_commands = ["plan", "validate"]
mock_outputs = {
project_id = "gc-t-prj-poc-0001-5473"
}
}
inputs = {
project = "gc-t-prj-poc-0001-5473"
name = "poc-df01"
region = "europe-west2"
type = "BASIC"
enable_stackdriver_logging = false
enable_stackdriver_monitoring = false
#labels = var.labels
private_instance = true
network_config = {
network_id = "projects/gc-a-prj-vpchost-0001-3312/global/networks/gc-t-vpc-0001"
ip_allocation = "default"
}
version = "default"
#namespace = "default"
peer_name = "gc-t-testfusionpeer-0001" #gc-t-ip-datafusion-0001
network_id = "projects/gc-a-prj-vpchost-0001-3312/global/networks/gc-t-vpc-0001"
data_fusion_network = "projects/gc-a-prj-vpchost-0001-3312/global/networks/gc-t-datafusion-0001"
export_custom_routes = true
import_custom_routes = true
Here is the main.tf of the module
terraform {
required_providers {
cdap = {
source = "GoogleCloudPlatform/cdap"
# Pin to a specific version as 0.x releases are not guaranteed to be backwards compatible.
version = "0.9.0"
}
}
}
provider "cdap" {
host = "${module.datafusion_instance.wait_healthy_service_endpoint}/api/"
token = data.google_client_config.current.access_token
}
data "google_client_config" "current" {}
resource "google_data_fusion_instance" "this" {
provider = google-beta
project = var.project
name = var.data_fusion_instance
description = "Data Fusion instance for ${var.region}"
region = var.region
type = "BASIC"
enable_stackdriver_logging = false
enable_stackdriver_monitoring = false
labels = var.labels
private_instance = true
network_config {
network = var.network_id
ip_allocation = var.ip_allocation # format: "10.89.48.0/22"
}
version = var.data_fusion_version
#dataproc_service_account = data.google_app_engine_default_service_account.default.email
}
#resource "cdap_namespace" "namespace" {
#name = var.namespace
#}
resource "google_compute_network_peering" "peering" {
name = var.peer_name
network = var.network_id
peer_network = var.data_fusion_network
export_custom_routes = var.export_custom_routes
import_custom_routes = var.import_custom_routes
}
It looks like part of it is deployed and the network peer is created

I am officially stumped.
Solution 1:[1]
The error that is coming from the API makes it seem like the CDF instance name is missing. Instance creation requests need an instance name to be supplied when creating.
I see in your inputs that you list the CDF instance name as name = "poc-df01".
However, in the resource definition, I see you try to use the name = var.data_fusion_instance, and it doesn't seem you have data_fusion_instance configured in the input variables.
Can you check if the variables are set correctly?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
