gomorpheus / terraform-provider-morpheus

Terraform Morpheus provider
MIT License
17 stars 21 forks source link

[BUG]resource morpheus_api_option_list lacks of instanceTypeClouds #196

Closed jigeay closed 10 months ago

jigeay commented 10 months ago

On GUI, we can choose all these options : image but provider can't manage all of them : Error: expected option_list to be one of ["clouds" "instanceTypeClouds" "environments" "groups" "instances" "instance-wiki" "networks" "instanceNetworks" "servicePlans" "resourcePools" "securityGroups" "servers" "server-wiki"], got instanceTypeLayouts

for instance, i need Instance Type Layout

resource "morpheus_api_option_list" "azrlayouts" {
  name               = "azrLayouts"
  description        = "Azure Layouts option list"
  labels             = ["vmcreation", "terraform_managed", "azure"]
  visibility         = "private"
  option_list        = "instanceTypeLayouts"
  translation_script = <<SCRIPT
if (input.azrCloud) {
    for (var x = 0; x < data.length; x++) {
        results.push({name:data[x].name + ' ' + data[x].version, value:data[x].id });
    }
}
  SCRIPT

  request_script = <<SCRIPT
    if (input.azrCloud  ) {
      results.zoneId = input.azrCloud.split(':')[0]
      results.siteId  = ${data.morpheus_group.azuregroup.id}
    }
  SCRIPT
}

would you please add it ?

best regards,

Matthieu

martezr commented 10 months ago

This issue has been resolved in the latest release of the provider (https://github.com/gomorpheus/terraform-provider-morpheus/releases/tag/v0.9.8).