An open API service indexing awesome lists of open source software.

https://github.com/cycloidio/tfdocs

Generated structured documentation for Terraform Providers
https://github.com/cycloidio/tfdocs

Last synced: 11 months ago
JSON representation

Generated structured documentation for Terraform Providers

Awesome Lists containing this project

README

          

# tfdocs

This package is autogenerated from the [Terraform Registry](https://registry.terraform.io/browse/providers) for all the providers that are Official and Verified. If one is missing we can manually add them.

In the `cmd/` there is the logic to generate the actual documentation of each Provider.

The generated documentation is placed inside a package `providers/` with the name of the provider, so for `aws` would be `providers/aws`. Inside of it there are 2 files, one for the Resources (`r.go`) and another for the DataSources (`d.go`).

## Documentation

Each Provider package have the same 4 exported varables and functions

The exported variables and functions are:

### `var Resources []*Resource`:

List of all the Resources of the Provider

### `func GetResource(r string) (*resource.Resource, error)`:

Returns the specific Resource for the resource type, example: `aws_iam_user`

### `var DataSources []*Resource`:

List of all the DataSources of the Provider

### `func GetDataSource(r string) (*resource.Resource, error)`:

Returns the specific DataSource for the resource type, example: `aws_vpcs`

## Icons (`assets/`)

To add icons we need a JSON that connects the resource name (`aws_lb`) to the actual path (`Compute/Elastic-Load-Balancing-ELB.svg`). This is done inside the `assets/` directory, there we have a folder for each Provider that may have icons. The path to the actual JSON has to be `assets/{{ ProviderName }}/icons.json` and for the format is a simple KV where K == resource name and V == path.

The path has to be the one from the official Provider source after download:
* aws: https://aws.amazon.com/architecture/icons/ (currently the 20200430)
* google: https://cloud.google.com/icons
* openstack: https://github.com/openstack/horizon/tree/master/openstack_dashboard/static/dashboard/img
* azurerm: https://docs.microsoft.com/en-us/azure/architecture/icons/