Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Error: Reference to undeclared resource #162

Closed
JasonPodgorny opened this issue Jul 15, 2019 · 1 comment
Closed

Error: Reference to undeclared resource #162

JasonPodgorny opened this issue Jul 15, 2019 · 1 comment

Comments

@JasonPodgorny
Copy link

JasonPodgorny commented Jul 15, 2019

vRA 7.x version
vRA 7.4

Terraform version
terraform-provider-vra7 plugin version

./terraform -version

Terraform v0.12.4

  • provider.vra7 (unversioned)

Describe the bug
Creating a terraform config that follows the conventions found in the readme and in many online examples, it is now allowing to submit properties the request needs indicating the resource is not found in the root module.

To Reproduce
Steps to reproduce the behavior:

  1. Terraform config file

variable "username" {
}
variable "password" {
}
variable "tenant" {
}
variable "host" {
}

provider "vra7" {
username = "${var.username}"
password = "${var.password}"
tenant = "${var.tenant}"
host = "${var.host}"
insecure = false
}

resource "vra7_deployment" "example" {
count = 1
catalog_item_name = "JPTEST: RHEL72"
reasons = "I have some"
description = "deployment via terraform"
resource_configuration = {
testvm.cpu = 2
}
}

  1. Terraform command
    terraform plan
    terraform apply

  2. Error

Error: Reference to undeclared resource

on main.tf line 25, in resource "vra7_deployment" "example":
25: testvm.cpu = 2

A managed resource "testvm" "cpu" has not been declared in the root module.

Expected behavior
Terraform gets the catalog item, finds the testvm resource on it which is the name of the virtual machine in the blueprint, and applies the property as specified in the terraform configuration

Screenshots
Attached screenshot of vRA form that shows the testvm resource
vra_capture

Logs
vra-terraform.log is empty
terraform.log is attached
terraform.log

Desktop (please complete the following information):

  • OS: Red Hat Enterprise Linux Server release 7.2 (Maipo)

Additional context
This example shows the cpu property, but the same happens for any property against the testvm resource.

@markpeek
Copy link
Contributor

Thank you for the issue. Working with terraform v0.12 is being tracked in the official repo via:
https://github.com/terraform-providers/terraform-provider-vra7/issues/13
https://github.com/terraform-providers/terraform-provider-vra7/pull/17

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants