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

vsphere_content_library_item expecting undocumented argument #1245

Closed
Sonic-Pancake opened this issue Oct 23, 2020 · 3 comments · Fixed by #1507
Closed

vsphere_content_library_item expecting undocumented argument #1245

Sonic-Pancake opened this issue Oct 23, 2020 · 3 comments · Fixed by #1507
Labels
bug Type: Bug

Comments

@Sonic-Pancake
Copy link

Terraform Version

0.13.3

vSphere Provider Version

1.24.1 and 1.24.2

Affected Resource(s)

  • Data Source - vsphere_content_library_item

Terraform Configuration Files

in 1.24.0 This worked

data "vsphere_content_library_item" "image" {
  name       = var.base_image
  library_id = data.vsphere_content_library.content_lib.id
}

In version 1.24.1 and 1.24.2 I now need to use this:

data "vsphere_content_library_item" "image" {
  name       = var.base_image
  library_id = data.vsphere_content_library.content_lib.id
  type = "VM-TEMPLATE"
}

Expected Behavior

Terraform should run without complaining I'm missing an argument and I shouldn't need to add the type argument according to the documentation.

Actual Behavior

Error: Missing required argument

  on main.tf line 86, in data "vsphere_content_library_item" "image":
  86: data "vsphere_content_library_item" "image" {

The argument "type" is required, but no definition was found.

Steps to Reproduce

  1. Create a terraform file with enough information to connect to vcenter that contains a content library and vm template
  2. Fill in the appropriate name and library_id information.
  3. Run Terraform apply

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
@Sonic-Pancake Sonic-Pancake added the bug Type: Bug label Oct 23, 2020
@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Nov 1, 2021

The type was added to the vsphere_content_library_item in 7d83a8a#diff-59360f584f8f07cd75690f835baf71576e2a064e091268f7d3364611cd75bea3. As such, when this was added there would have been design choice to set this a Required vs Optional and setting vm-template as the default.

The result was a good design choice for the data source to require; however, the data source documentation was not appropriately updated.

I'll be happy to address the issues in thr documentation and update the example(s).

Ryan
@tenthirtyam

@tenthirtyam
Copy link
Collaborator

Submitted #1507 to address the gap in the documentation for the type argument and updated the examples.

Ryan
@tenthirtyam

appilon pushed a commit that referenced this issue Jan 19, 2022
- Addresses #1340 -  `name` argument description error. Updates the argument description.
- Addressed #1245 - documentation gap. Updates the documentation with the required `type` argument. Updates the example usage to depict each `type`.
- Minor formatting and context updates for accuracy.

Signed-off-by: Ryan Johnson <[email protected]>
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants