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

parse_resource_id with Resource Group id doesn't populate the resource_name #28295

Open
1 task done
DevopsMercenary opened this issue Dec 16, 2024 · 1 comment · May be fixed by #28329
Open
1 task done

parse_resource_id with Resource Group id doesn't populate the resource_name #28295

DevopsMercenary opened this issue Dec 16, 2024 · 1 comment · May be fixed by #28329

Comments

@DevopsMercenary
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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 comments along the lines of "+1", "me too" or "any updates", 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 and review the contribution guide to help.

Terraform Version

v1.9.8

AzureRM Provider Version

4.13.0

Affected Resource(s)/Data Source(s)

provider::azurerm::parse_resource_id

Terraform Configuration Files

locals {

  resource-map = provider::azurerm::parse_resource_id( "/subscriptions/00000000-18f0-45f6-abf6-3bcd9058d3eb/resourceGroups/devops-storage-account" )

}

Debug Output/Panic Output

N/A

Let me know if you really need it

Expected Behaviour

local.resource-map.resource_name would have returned the name of the resource group devops-storage-account

Actual Behaviour

local.resource-map.resource_name returns "" ( empty string )

Perhaps this is a nit picky edge case, but it makes sense to me that if a resource_group id is parsed then the resource_name should be set to the name of the resource group. The mapping of local.resource-map.resource_group_name does work correctly.

Making this change would be handy. If this change was made, I could rely on the function to always return the (common) name of the resource and I wouldn't have to check for empty string and 'guess' that a resource_group was provided. I'm using this to name azuread_groups dynamically where the scope could be the resource or the resource group.

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@rcskosir
Copy link
Contributor

rcskosir commented Jan 7, 2025

Thank you for taking the time to open this issue. Please subscribe to PR #28329 created for this issue.

@rcskosir rcskosir added the bug label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants