terraform-provider-postgresql
terraform-provider-postgresql copied to clipboard
Docs page urls incompatible with terraform-docs
Terraform Version
Terraform v1.5.7
on darwin_arm64
+ provider registry.terraform.io/cyrilgdn/postgresql v1.21.0
Affected Resource(s)
- website/documentation
Terraform Configuration Files
N/A
Expected Behavior
Links to provider's resources generated by terraform-docs should be correct.
Actual Behavior
Links return 404.
Steps to Reproduce
- In empty folder create
test.tf
with following contentsresource "postgresql_database" "test" { name = "test" }
- run
terraform-docs markdown table --show resources .
- output:
## Resources | Name | Type | |------|------| | [postgresql_database.test](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/database) | resource |
Important Factoids
Out of all terraform providers I use (aws, vault, random etc) only this one has problem with links generated by terraform-docs. Checking other providers website folders (https://github.com/hashicorp/terraform-provider-vault/tree/main/website/docs/r or https://github.com/hashicorp/terraform-provider-aws/tree/main/website/docs/r) I see that page names aren't prefixed with provider name. But with this provider they are (https://github.com/cyrilgdn/terraform-provider-postgresql/tree/master/website/docs/r).
This isn't a problem for registry or viewing docs via browser, everything works as expected. It's a problem for documentation generated by terraform-docs when referencing resources from this provider.
I looked into https://developer.hashicorp.com/terraform/tutorials/providers/provider-release-publish#document-your-provider, and page name style isn't defined. There is some more info at https://github.com/hashicorp/terraform-plugin-docs#conventional-paths, but it doesn't define names well tool.
References
Similar issue created on terraform-docs side for other provider, but I believe terraform-docs isn't able to fix it as link generation is based on assumption/convention of how pages should be named.
- https://github.com/terraform-docs/terraform-docs/issues/679