0

I am trying to create the VM in vmware vcloud director 10 using terraform VCD provider.

Version

terraform {
  required_providers {
    vcd = {
      source  = "vmware/vcd"
      version = "3.0.0"
    }
  }
}

Main code:

resource "vcd_vapp" "vms" {
  name     = "apatsev-vapp"
  power_on = "true"

}

resource "vcd_vapp_vm" "vm1" { vapp_name = "apatsev_vm" name = "apatsev1" catalog_name = "CentOS" template_name = "CentOS7_64-bit" memory = 2048 cpus = 2 cpu_cores = 1

depends_on = [vcd_vapp.vms]

}

Error:

Error: error finding vApp: [ENF] entity not found

on main.tf line 28, in resource "vcd_vapp_vm" "vm1": 28: resource "vcd_vapp_vm" "vm1" {

How fix error?

1 Answers1

0

Worked code:

resource "vcd_vapp" "vms" {
  name     = "apatsev-vapp"
  power_on = "true"

}

resource "vcd_vapp_vm" "vm1" { vapp_name = vcd_vapp.vms.name name = "apatsev1" catalog_name = "CentOS" template_name = "CentOS7_64-bit" memory = 2048 cpus = 2 cpu_cores = 1

depends_on = [vcd_vapp.vms]

}