Skip to content

Error: Cannot Import vra_blueprint_version Resources #606

@bjf-rga

Description

@bjf-rga

Code of Conduct

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

vRA Version

8.18.1

Terraform Version

1.12.2
1.13.5

vRA Terraform Provider Version

v0.15.0

Affected Resource(s)

Terraform Configuration Files

resource "vra_blueprint" "shake_and_bake" {
  name       = "ShakeAndBake"
  project_id = "<valid id here>"
  content    = "<valid yml here>"
}

resource "vra_blueprint_version" "shake_and_bake" {
  blueprint_id = vra_blueprint.shake_and_bake.id
  version      = md5(vra_blueprint.shake_and_bake.content)
  release      = true
}

Expected Behavior

The provider should be capable of importing an existing blueprint version.

Actual Behavior

It fails with an error.

Steps to Reproduce

  1. Create a blueprint and a version outside of Terraform
  2. Import the blueprint by its uuid (this works fine)
  3. Attempt to import the blueprint version by its id (e.g. terraform import vra_blueprint_version.shake_and_bake <version from console>) -- this fails

Screenshots

$ tf import vra_blueprint_version.shake_and_bake 72a55b7d778ecef7c15d5b03d1c3ac13                                                   
                                                                                      
vra_blueprint_version.shake_and_bake: Importing from ID "72a55b7d778ecef7c15d5b03d1c3ac13"...                                                                                      
vra_blueprint_version.shake_and_bake: Import prepared!                                                                                                                             
  Prepared vra_blueprint_version for import                                                                                                                                        
vra_blueprint_version.shake_and_bake: Refreshing state... [id=72a55b7d778ecef7c15d5b03d1c3ac13]                                                                                    
╷                                                                                                                                                                                  
│ Error: Cannot import non-existent remote object                                                                                                                                  
│                                                                                                                                                                                  
│ While attempting to import an existing object to "vra_blueprint_version.shake_and_bake", the provider detected that no object exists with the given id. Only pre-existing        
│ objects can be imported; check that the id is correct and that it is associated with the provider's configured region or endpoint, or use "terraform apply" to create a new      │ remote object for this resource.                                                                                                                                                 ╵

Debug Output

I only need one line to show the problem; not creating a gist.

2025-11-18T11:20:31.312-0600 [INFO]  provider.terraform-provider-vra_v0.15.0: 2025/11/18 11:20:31 {"timestamp":"2025-11-18T17:20:31.341+00:00","status":404,"error":"Not Found","me
ssage":"No static resource blueprint/api/blueprints/versions/72a55b7d778ecef7c15d5b03d1c3ac13.","path":"/blueprint/api/blueprints/versions/72a55b7d778ecef7c15d5b03d1c3ac13"}: time
stamp=2025-11-18T11:20:31.312-0600

Panic Output

n/a

Important Factoids

The API call made by the provider to find the blueprint version is invalid. The provider is calling the URI: blueprint/api/blueprints/versions/<import id here>.

The valid URI format is: blueprint/api/blueprints/<blueprint id here>/versions/<version id here>.

This likely means that the entire structure used for storing a blueprint id in state is invalid, as the identifier is the tuple of blueprint id and that blueprint's version. Either the blueprint version needs a separate GUID that represents that tuple, or the import needs to permit a formatted string, something like:

terraform import vra_blueprint_version.RESOURCE_NAME <blueprint id>:<blueprint version>

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions