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

Empty list with azurerm_public_ips without filters #13497

Closed
nerddtvg opened this issue Sep 24, 2021 · 1 comment · Fixed by #13500
Closed

Empty list with azurerm_public_ips without filters #13497

nerddtvg opened this issue Sep 24, 2021 · 1 comment · Fixed by #13500

Comments

@nerddtvg
Copy link
Contributor

nerddtvg commented Sep 24, 2021

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 "me too" comments, 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

Terraform (and AzureRM Provider) Version

Terraform v1.0.7
on windows_amd64
+ provider registry.terraform.io/hashicorp/azurerm v2.76.0
+ provider registry.terraform.io/hashicorp/kubernetes v2.5.0

Affected Resource(s)

  • azurerm_public_ips

Terraform Configuration Files

data "azurerm_public_ips" "ips" {
  resource_group_name = "resource-group-name"
}

Debug Output

I do not have sanitized debug output I can provide. If needed, I will attempt to recreate this in a private subscription.

Expected Behaviour

With no filters (attached, name_prefix, or allocation_type), I would have expected all public IPs inside that resource group to be listed. All of these filters are listed as optional and no error is thrown.

Actual Behaviour

The public_ips list is empty.

Steps to Reproduce

  1. Create resource group
  2. Create one or more public IPs
  3. Add the data source to Terraform
  4. Run terraform refresh
  5. Check state file to see the data source is empty
  6. Change the data source to include attached = true
  7. Refresh again
  8. Verify the state file has IPs

Source of Issue

attachedOnly := d.Get("attached").(bool)
if attachedOnly != nicIsAttached {
continue
}

This code checks if it is attached or not no matter if attached is actually set. If attached is null, it should be bypassed.

@github-actions
Copy link

github-actions bot commented Nov 5, 2021

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 Nov 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants