-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
[WIP] Adds parseurl function #32328
base: main
Are you sure you want to change the base?
[WIP] Adds parseurl function #32328
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is missing the optional port in the URL, see https://url.spec.whatwg.org/#url-representation
Host contains the port, as it's calling url.Host and not https://pkg.go.dev/net/url#URL.Hostname. |
Good find 💪 I think it would be useful to seperate the hostname and port, will push the changes shortly. |
Thanks for this submission! I suspect this function would need to be built as a plugin function provider, as opposed to a function built into Terraform. As such it would be waiting for the implementation of plugin function providers. Please see: That said, I'll bring it to triage and see if it could be considered as a built-in function. Thanks again for this submission! |
This would be quite nice to have built in IMO. =) |
For posterity, the core team conversation on the |
would love to see this! |
This adds this functionality as a data source. https://registry.terraform.io/providers/northwood-labs/corefunc/latest/docs/data-sources/url_parse |
Description
Introduces the
parseurl
language function which parses a URL string into a map containing the URL segmentsFixes #23893
Usage
Target Release
1.4.0
Draft CHANGELOG entry
NEW FEATURES
parseurl
language function which parses a URL string into a map containing the URL segments