vmware / terraform-provider-vra

Terraform Provider for VMware Aria Automation
https://registry.terraform.io/providers/vmware/vra/
Mozilla Public License 2.0
103 stars 90 forks source link

Unable to update deployment on unreleased cloud template version #477

Closed an2ane closed 1 year ago

an2ane commented 1 year ago

Code of Conduct

This project has a Code of Conduct that all participants are expected to understand and follow:

vRA Version

vRA Cloud in 8.10.1

Terraform Version

Terraform v1.2.6 on windows_amd64

vRA Terraform Provider Version

Affected Resource(s)

vra_deployment

Terraform Configuration Files

data "vra_catalog_item" "vmaas" {
  name = "${var.catalog_item_name_vmaas}"
}

resource "vra_deployment" "vm" {
  name        = "terra-${local.timerand}"
  description = "Generated by Terraform"

  catalog_item_id      = data.vra_catalog_item.vmaas.id
  # catalog_item_version = "0.6.5"
  project_id           = data.vra_project.this.id

  inputs = {
    ...
  }
}

Expected Behavior

The updated values should be taken into account, and the update should be running on the portal, as if the update was launched on the portal. It does work on the vRA portal even though the version is unrealased.

Actual Behavior

There is a call to get the cloud template version, however we get a 404 error even if the catalog item version is set to the deployment version.

vra_deployment.vm: Modifying... [id=some_random_id] ╷ │ Error: [GET /catalog/api/items/{id}/versions/{versionId}][404] getVersionByIdUsingGET2NotFound &{Message:No value present StatusCode:404} │ │ with vra_deployment.vm, │ on vm_deployment.tf line 43, in resource "vra_deployment" "vm": │ 43: resource "vra_deployment" "vm" { │

Steps to Reproduce

Community Note

an2ane commented 1 year ago

Also, if we put the catalog_item_version as the latest version, then it will destroy then recreate the resource. Not really the behavior we want :)

This might become annoying for our users.

an2ane commented 1 year ago

It was fixed in https://github.com/vmware/terraform-provider-vra/releases/tag/v0.7.3