Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Machine Catalog from Variables #55

Closed
amshaffer opened this issue Mar 27, 2024 · 3 comments · Fixed by #79
Closed

Building Machine Catalog from Variables #55

amshaffer opened this issue Mar 27, 2024 · 3 comments · Fixed by #79
Assignees
Labels
enhancement New feature or request

Comments

@amshaffer
Copy link

I'm trying to use variables for deploying an AWS-hosted manual machine catalog with multiple VDAs, and I'm getting the following error when running terraform plan. I'm sure I've just done something wrong or not expected, but would appreciate a bit of help to see if this is something in the provider.

> terraform plan
╷
│ Error: Value Conversion Error
│
│   with citrix_machine_catalog.aws-catalog,
│   on machine_catalogs.tf line 1, in resource "citrix_machine_catalog" "aws-catalog":
│    1: resource "citrix_machine_catalog" "aws-catalog" {
│
│ An unexpected error was encountered trying to build a value. This is always an error in the provider. Please report the
│ following to the provider developer:
│
│ Received unknown value, however the target type cannot handle unknown values. Use the corresponding `types` package type or a
│ custom type that handles unknown values.
│
│ Path: machine_accounts[0].machines
│ Target Type: []machine_catalog.MachineCatalogMachineModel
│ Suggested Type: basetypes.ListValue

The output that this is an error in the provider made me decide to open this bug, despite thinking I've probably built the variables incorrectly. Is there a straightforward way to use the MachineCatalogMachineModel type in this fashion with variables, or some other method to achieve this goal?

variables.tf:

variable "machines" {
  type = list(object({
    machine_account   = string
    machine_name      = string
    availability_zone = string
  }))
  description = "VDA details"
}

terraform.tfvars:

machines = [
  {
    machine_account   = "DOMAIN\\VDA1"
    machine_name      = "i-12345678"
    availability_zone = "us-east-1"
  },
  {
    machine_account   = "DOMAIN\\VDA2"
    machine_name      = "i-87654321"
    availability_zone = "us-east-1"
  }
]

And the relevant code in the machine catalog resource:

  machine_accounts = [
    {
      hypervisor = citrix_aws_hypervisor.aws-hypervisor.id
      machines   = var.machines
    }
  ]

Thank you!

@xushengl
Copy link
Contributor

Hi @amshaffer

Thanks for reporting this issue, we will investigate it and keep you posted.

Xusheng "Fred" Liu

@xushengl xushengl added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Mar 27, 2024
@xushengl
Copy link
Contributor

Hi @amshaffer

At the current point, we cannot use variables for machine_accounts.machines. Please input the list directly for now. We will let you know when we add support to use the list variable.

Xusheng "Fred" Liu

@amshaffer
Copy link
Author

@xushengl Got it, thanks!

@AlanCitrix AlanCitrix self-assigned this May 8, 2024
@xushengl xushengl mentioned this issue Jun 17, 2024
@xushengl xushengl linked a pull request Jun 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants