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

azurerm_resources - does not return all matched resources sometimes #7036

Merged
merged 4 commits into from May 21, 2020

Conversation

njuCZ
Copy link
Contributor

@njuCZ njuCZ commented May 21, 2020

CX team is using terraform data source data "azurerm_resources" to retrieve resources and are using those values to perform some automated deployments.

Sometimes, the output of the azurerm_resources presents with no values in first iteration and a nextLink. this doc says that the expected output is of type "resources"

I don't see a way to access the nextLink property in terraform (as far as I researched) the problem with nextLink is that since the first value is null, it is throwing error stating index not available

28: managed_relay_name = data.azurerm_resources.databricks_managed_relay.resources.name data.azurerm_resources.databricks_managed_relay.resources is empty list of object
The given key does not identify an element in this collection value.

fixes #7035

@ghost ghost added the size/S label May 21, 2020
@WodansSon WodansSon changed the title fix issue: could not return all matched resources sometimes azurerm_resources - does not return all matched resources sometimes May 21, 2020
Copy link
Collaborator

@WodansSon WodansSon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@njuCZ thanks for the PR, LGTM! 🚀

@WodansSon WodansSon added this to the v2.12.0 milestone May 21, 2020
@WodansSon WodansSon added service/resources bug upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR labels May 21, 2020
@WodansSon WodansSon modified the milestones: v2.12.0, v2.11.0 May 21, 2020
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@WodansSon
Copy link
Collaborator

image

@WodansSon WodansSon merged commit 46df426 into hashicorp:master May 21, 2020
WodansSon added a commit that referenced this pull request May 21, 2020
@ghost
Copy link

ghost commented May 22, 2020

This has been released in version 2.11.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.11.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jun 21, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug service/resources size/S upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data azurerm_resources could not return all matched resources sometimes
3 participants