You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Efficient Access to Documentation:As a Terraform user, I often need to refer to provider plugin documentation. Currently, this requires switching to the Terraform Registry, which disrupts my workflow.
Discovery of Resources and Data Sources: It's difficult to quickly identify available resources and data sources for a provider without manually browsing the Registry.
Offline or Simplified Access:There’s no straightforward way to fetch and access documentation directly within the terminal, especially when working offline
Streamlined Exploration:New providers or unfamiliar resources require constant back-and-forth between the terminal and the Registry, which is inefficient.
Improved Developer Experience:A built-in command for documentation would help both users and developers by reducing lookup time and enabling quick reference during development or debugging.
Attempted Solutions
Manual Access via Registry: Opened the Terraform Registry in a browser, searched for the provider, and manually located the relevant resource or data source. This process is time-consuming and disrupts the terminal-focused workflow.
Using terraform providers Command: Used the existing terraform providers command to list installed providers. This command does not offer detailed documentation or an overview of resources and data sources.
Downloading Provider Repositories: Cloned provider repositories to explore documentation. This is not a scalable solution and requires additional effort to locate relevant information.
Proposal
Introduce a new Terraform command: terraform docs
Key Features:
Fetch Documentation for Installed Providers
Display an overview of provider-specific resources and data sources.
List Available Resources and Data Sources
List all available options for a provider in a clear, terminal-friendly format.
Fetch Resource-Specific Documentation
Display detailed documentation for a specific resource or data source.
Shows provider documentation for resources and data sources.
Options:
-l List all available resources and data sources
Examples:
terraform docs aws -l # List all AWS provider resources and data sources
terraform docs random random_id # Show documentation for the random_id resource
Additional Proposal:
Cache fetched documentation for offline use.
Include links to official Terraform Registry pages when displaying resource documentation for users requiring more details.
Example Scenarios:
List all resources and data sources:
terraform docs aws -l
Output:
Resources:
aws_instance
aws_s3_bucket
aws_vpc
Data Sources:
aws_ami
aws_subnet
aws_vpc_endpoint
View detailed documentation for a specific resource:
terraform docs aws aws_instance -r
Output:
Resource: aws_instance
Description: Manages an EC2 instance on AWS.
Arguments:
- ami (string) - ID of the AMI to use for the instance.
- instance_type (string) - Type of instance to start.
Example:
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!
Terraform Version
Use Cases
Efficient Access to Documentation:As a Terraform user, I often need to refer to provider plugin documentation. Currently, this requires switching to the Terraform Registry, which disrupts my workflow.
Discovery of Resources and Data Sources: It's difficult to quickly identify available resources and data sources for a provider without manually browsing the Registry.
Offline or Simplified Access:There’s no straightforward way to fetch and access documentation directly within the terminal, especially when working offline
Streamlined Exploration:New providers or unfamiliar resources require constant back-and-forth between the terminal and the Registry, which is inefficient.
Improved Developer Experience:A built-in command for documentation would help both users and developers by reducing lookup time and enabling quick reference during development or debugging.
Attempted Solutions
Manual Access via Registry: Opened the Terraform Registry in a browser, searched for the provider, and manually located the relevant resource or data source. This process is time-consuming and disrupts the terminal-focused workflow.
Using terraform providers Command: Used the existing terraform providers command to list installed providers. This command does not offer detailed documentation or an overview of resources and data sources.
Downloading Provider Repositories: Cloned provider repositories to explore documentation. This is not a scalable solution and requires additional effort to locate relevant information.
Proposal
Introduce a new Terraform command:
terraform docs
Key Features:
terraform docs -h
Usage: terraform docs [options] [resource(data)_name] [-r/-d flag] ''
Shows provider documentation for resources and data sources.
Options:
-l List all available resources and data sources
Examples:
terraform docs aws -l # List all AWS provider resources and data sources
terraform docs random random_id # Show documentation for the random_id resource
Additional Proposal:
Example Scenarios:
terraform docs aws -l
Output:
Resources:
Data Sources:
View detailed documentation for a specific resource:
terraform docs aws aws_instance -r
Output:
References
No response
The text was updated successfully, but these errors were encountered: