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

data var_image arguments #441

Closed gsbagga closed 2 years ago

gsbagga commented 2 years ago

Code of Conduct

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

vRA Version

8.7

Terraform Version

1.1.7

vRA Terraform Provider Version

0.5.1

Affected Resource(s)

var_image

Terraform Configuration Files

# Copy-paste your Terraform configurations here.
# For large Terraform configs, please use a service like Dropbox and share a link to the ZIP file.

data "vra_image" "rhel7" { id = var.rhel7_ami }

Expected Behavior

retrieve image name by providing ami id of the image

Actual Behavior

Error: Missing required argument As per the documentation I should be able to pass only ID as the argument. https://registry.terraform.io/providers/vmware/vra/latest/docs/data-sources/vra_image

Steps to Reproduce

Screenshots

Debug Output

Panic Output

Important Factoids

References

Community Note

tenthirtyam commented 2 years ago

Filter is a required argument.

https://github.com/vmware/terraform-provider-vra/blob/a2313c06166fcf492349683e382ba4b349be645a/vra/data_source_image.go#L15-L18

Ideally, the documentation should reflect if an argument is required or optional as well as update the inaccurate "id only" example.

Recommend this for docs updates. @frodenas I'd be happy to PR this one of you like.

Example with the use of filter:

https://github.com/tenthirtyam/terrafom-examples-vmware/blob/main/vra/vra-image-mapping/main.tf

Ryan Johnson Staff II Solutions Architect | VMware, Inc.

gsbagga commented 2 years ago

Ryan,

Thanks for sharing the example and asking for docs to be updated to reflect this.

Is it possible for you to add an example of adding a network profile for AWS and Azure? It will be very helpful.

tenthirtyam commented 2 years ago

Hi, @gsbagga 👋

I'll submit a PR next week to resolve the concern in the docs for this resource.

For your other request, please submit an issue on my personal project and I'll work on adding some additional examples for hyperscalers.

Ryan Johnson Staff II Solutions Architect | VMware, Inc.

frodenas commented 2 years ago

Thanks @tenthirtyam for your help here :)

tenthirtyam commented 2 years ago

Pull request has been GH-442 submitted for review, @frodenas. 😄

Ryan Johnson Staff II Solutions Architect | VMware, Inc.