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

Show provider source in requirements section #643

Open
nitrocode opened this issue Oct 18, 2022 · 3 comments · May be fixed by #650
Open

Show provider source in requirements section #643

nitrocode opened this issue Oct 18, 2022 · 3 comments · May be fixed by #650

Comments

@nitrocode
Copy link
Contributor

nitrocode commented Oct 18, 2022

What problem are you facing?

If I change the template provider from this in my versions.tf file

# versions.tf
terraform {
  required_providers {
    template = {
      source  = "hashicorp/template"
      version = "~> 2.2.0"
    }
  }
}

to this

# versions.tf
terraform {
  required_providers {
    template = {
      source  = "cloudposse/template"
      version = "~> 2.2.0"
    }
  }
}

The provider source should also change in the markdown. However, the source is not shown and only the name of the provider is shown.

How could terraform-docs help solve your problem?

In addition to name and version, we should also include source with a link back to the github repo or terraform registry.

e.g.

name source version
template hashicorp/template ~> 2.2.0

Or

name source version
template cloudposse/template ~> 2.2.0

In markdown

| name  | source | version |
| ------------- | ------------- | ------------- |
| template  | [cloudposse/template](https://registry.terraform.io/providers/cloudposse/template/latest/docs)  | ~> 2.2.0  |

Code ref

{{- range .Module.Requirements }}
{{ $version := ternary (tostring .Version) (printf " (%s)" .Version) "" }}
- {{ anchorNameMarkdown "requirement" .Name }}{{ $version }}
{{- end }}

@edgarsandi
Copy link
Contributor

Hi @nitrocode!
Can I try to work into this feature request?

@nitrocode
Copy link
Contributor Author

@edgarsandi if you'd like to implement this, please do not let me stop you 🚀 ❤️

edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Nov 4, 2022
edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Nov 4, 2022
edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Nov 4, 2022
…ormats to show the source of the requirements'

Signed-off-by: Edgar R. Sandi <[email protected]>
edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Nov 4, 2022
edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Nov 4, 2022
@edgarsandi edgarsandi linked a pull request Nov 4, 2022 that will close this issue
2 tasks
@budgester
Copy link

Looking forward to this getting merged

edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Jul 20, 2023
edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Jul 20, 2023
edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Jul 20, 2023
…ormats to show the source of the requirements'

Signed-off-by: Edgar R. Sandi <[email protected]>
edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Jul 20, 2023
edgarsandi added a commit to edgarsandi/terraform-docs that referenced this issue Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants