Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

ERROR: "resource_configuration" is not expected here. #67

Closed
BalajiTechs opened this issue May 1, 2020 · 4 comments
Closed

ERROR: "resource_configuration" is not expected here. #67

BalajiTechs opened this issue May 1, 2020 · 4 comments

Comments

@BalajiTechs
Copy link

BalajiTechs commented May 1, 2020

vRA 7.6.x version
Version: 7.6.0 (Build: 13027133)
Terraform version
Terraform v0.12.24
terraform-provider-vra7 plugin version
provider.vra7 v1.0.1

Describe the bug
I want to set hostname of the machine i want to create. Here is my config file

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

resource "vra7_deployment" "machine" {
  count             = 1
  catalog_item_name = "CentOS 7.0 x64"

  resource_configuration = {
    "Linux.cpu" = "2"
  }
}

when running command terraform plan, it throws below error

bash-4.2$ terraform plan

Error: Unsupported argument

  on main.tf line 13, in resource "vra7_deployment" "machine":
  13:   resource_configuration = {

An argument named "resource_configuration" is not expected here. Did you mean
to define a block of type "resource_configuration"?

To Reproduce
Steps to reproduce the behavior:

  1. Terraform config file
  2. Terraform command
  3. Error

Expected behavior
terraform plan command should not throw any error for 'resource_configuration' block.

Screenshots
If applicable, add screenshots to help explain your problem.

Logs
Attach logs to help debug the issue

  1. Attach vra-terraform.log
  2. Attach Terraform console log (Enable terraform logs following the steps mentioned in https://www.terraform.io/docs/configuration/environment-variables.html)
  3. crash.log(if any)

Desktop (please complete the following information):

  • OS: CentOS Linux 7

Additional context
Add any other context about the problem here.

@hobovirtual
Copy link

Hi @BalajiTechs

Version 1.x of the provider requires a new format for resource_configuration which you can see in the example

From what i can see in the example above, your blueprint component is named Linux so your resource_configuration should look something like this

resource "vra7_deployment" "deployment" {
  catalog_item_name = "CentOS 7.0 x64"              
  reasons = "provide a reason"
  description = "provide a description"

  resource_configuration {
    component_name = "Linux"

    configuration = {
      cpu = 2
     //if you want to set hostname in your terraform manifest
     hostname = "myvmisawesome" 
    }
  } 
}

Hope this can help you move forward!!!

@BalajiTechs
Copy link
Author

Thanks @hobovirtual .
Using above configuration doesn't throw the error mentioned in the issue. But at later stage it complains about the component_name = "Linux". How do i determine component_name for my blueprint?

@hobovirtual
Copy link

Hi @BalajiTechs

There's many ways to see this information, i think the simplest is either via the blueprint design form (if you have access)

image

or when you make a request in the portal

image

Other option is to get the request template via API following this documentation

@Prativa20
Copy link
Contributor

Hi @BalajiTechs

Hope you could figure out how to get the component name. Closing this issue as this is not a bug.

Thanks,
Prativa

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

3 participants