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

documentation: generate docs from provider schemas #248

Merged
merged 68 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
ef11703
tooling: vendor tfplugindocs to generate documentation from code
sauterp Feb 17, 2023
b76d94c
generate doc for deprecated anti-affinity group
sauterp Feb 17, 2023
be0d93e
generate sks clusters documentation with a custom template
sauterp Feb 20, 2023
4c9d401
generate deprecated compute instance doc
sauterp Feb 21, 2023
837a628
generate ssh_key docs
sauterp Feb 21, 2023
2194613
generate docs for iam access keys
sauterp Feb 21, 2023
4d8a2ec
generate docs for elastic ip resource
sauterp Feb 21, 2023
504cd94
generate doc for ssh_keypair rsource
sauterp Feb 21, 2023
a9584fa
generate docs for sks nodepools
sauterp Feb 21, 2023
5ee1638
generate docs for sks kubeconfig resource
sauterp Feb 21, 2023
7456c5d
generate doc for security group rules resource
sauterp Feb 21, 2023
d8a4c01
generated doc for security_group_rule resource
sauterp Feb 21, 2023
606267a
generate doc for security_group resource
sauterp Feb 21, 2023
066e373
generate doc for secondary_ipaddress resource
sauterp Feb 21, 2023
966f768
generate doc for private networks
sauterp Feb 21, 2023
563ed88
generate doc for nlb_service resource
sauterp Feb 21, 2023
4b0a9ad
generate doc for nlb resource
sauterp Feb 21, 2023
afc654c
generate doc for nic resource
sauterp Feb 21, 2023
020c54d
generate doc for deprecated network resource
sauterp Feb 21, 2023
461fe76
generate doc deprecated ipaddress resource
sauterp Feb 21, 2023
12a268a
generate doc for instance_pool resource
sauterp Feb 21, 2023
55defe3
generate doc for domain_record resource
sauterp Feb 21, 2023
01c9398
generate doc for domain resource
sauterp Feb 21, 2023
f71f6b0
generate doc for database resource
sauterp Feb 21, 2023
0b833f5
generate doc for compute_instance resource
sauterp Feb 21, 2023
a93bc39
generate doc for anti_affinity_group resource
sauterp Feb 21, 2023
70cc8f0
generate doc for deprecated affinity resource
sauterp Feb 21, 2023
68e9844
generate doc for the provider
sauterp Feb 22, 2023
569d9c3
move guides to the templates directory so they are copied to docs folder
sauterp Feb 22, 2023
711fd62
generate doc for template data source
sauterp Feb 22, 2023
6cee32a
generate doc for security_group data source
sauterp Feb 22, 2023
9865aa6
generate doc for private_network data source
sauterp Feb 22, 2023
e29ce5e
add template for data sources
sauterp Feb 22, 2023
7730cf9
generate doc for nlb data source
sauterp Feb 22, 2023
4f4c855
generate doc for deprecated network data source
sauterp Feb 22, 2023
828b5f8
generate doc for instance_pool_list data source
sauterp Feb 22, 2023
deede68
generate doc for instance_pool data source
sauterp Feb 22, 2023
3744375
generate doc for elastic_ip data source
sauterp Feb 22, 2023
7d428c6
generate doc for domain_record data source
sauterp Feb 22, 2023
a52f876
generate doc for domain data source
sauterp Feb 22, 2023
c49e5f5
generate doc for deprecated compute_template data source
sauterp Feb 22, 2023
6e654d4
generate doc for deprecated compute_ipaddress data source
sauterp Feb 22, 2023
8c1fbca
generate doc for compute_instance_list data source
sauterp Feb 22, 2023
9aa2c8a
generate doc for compute_instance data source
sauterp Feb 22, 2023
645cdf6
generate doc for deprecated compute data source
sauterp Feb 22, 2023
a412f79
generate doc for anti_affinity_group data source
sauterp Feb 22, 2023
ae34a9c
generate doc for deprecated affinity data source
sauterp Feb 22, 2023
44fc21e
add warnings for attributes where ForceNew == true
sauterp Feb 23, 2023
27f1faf
complete the ForceNew warning message in docs
sauterp Feb 23, 2023
2fe3162
add script and step to CI to check that the documentation is up to date
sauterp Feb 23, 2023
f34891a
test commit to verify that the CI step fails if the documentation
sauterp Feb 23, 2023
32b3758
show offending files in check-documentation-clean.sh output
sauterp Feb 23, 2023
aad0fbe
Revert "test commit to verify that the CI step fails if the documenta…
sauterp Feb 23, 2023
b1912ce
remove mistaken Deprecation subcategory from sks_kubeconfig resource
sauterp Feb 23, 2023
2f36528
update database docs after rebase
sauterp Feb 23, 2023
1662480
remove $ prefix from shell examples which don't have an output below
sauterp Feb 24, 2023
bb0d5eb
remove all $ in shell examples
sauterp Feb 24, 2023
ba4da7f
fix acc test
sauterp Feb 27, 2023
cdad37d
reintroduce accidentally deleted code
sauterp Feb 28, 2023
e18e23b
Revert "reintroduce accidentally deleted code"
sauterp Feb 28, 2023
c1dc61b
fix the broken example in intex.md
sauterp Feb 28, 2023
76ea6fd
run doc check in parallel job
sauterp Mar 2, 2023
4824dd6
fix action
sauterp Mar 2, 2023
82c457b
fix action
sauterp Mar 2, 2023
a92323c
fix action
sauterp Mar 2, 2023
bdbcdd2
provider page title to uppercase
sauterp Mar 2, 2023
8dd5e38
fix acc test
sauterp Mar 7, 2023
dfce7b7
fix acc test
sauterp Mar 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: "Shared setup steps"
runs:
using: "composite"
steps:
- uses: actions/setup-go@v2
with:
go-version: '~1.18'
11 changes: 8 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ on:
- 'v*' # Don't run CI tests on release tags

jobs:
check-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup
- name: Check documentation is up to date
run: './scripts/check-documentation-clean.sh'
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '~1.18'
- uses: ./.github/actions/setup
- name: Run tests
run: |
git submodule update --init --recursive go.mk
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Terraform configuration files referencing [Exoscale provider
resources][tf-exo-doc]:

```console
$ terraform init
terraform init

Output:

Initializing the backend...

Expand Down
19 changes: 9 additions & 10 deletions docs/data-sources/affinity.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
page_title: "Exoscale: exoscale_affinity"
subcategory: "Deprecated"
description: |-
page_title: "exoscale_affinity Data Source - terraform-provider-exoscale"
subcategory: "Deprecated
"description: |-
Fetch Exoscale Anti-Affinity Groups data.
---

# exoscale\_affinity
# exoscale_affinity (Data Source)

!> **WARNING:** This data source is DEPRECATED and will be removed in the next major version. Please use [exoscale_anti_affinity_group](./anti_affinity_group.md) instead.


## Arguments Reference

* `id` - The anti-affinity group ID to match (conflicts with `name`)
* `name` - The group name to match (conflicts with `id`)
<!-- schema generated by tfplugindocs -->
## Schema

### Optional

## Attributes Reference
- `id` (String) The anti-affinity group ID to match (conflicts with `name`)
- `name` (String) The group name to match (conflicts with `id`)

In addition to the arguments listed above, the following attributes are exported:

* n/a
27 changes: 15 additions & 12 deletions docs/data-sources/anti_affinity_group.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
page_title: "Exoscale: exoscale_anti_affinity_group"
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "exoscale_anti_affinity_group Data Source - terraform-provider-exoscale"
subcategory: ""
description: |-
Fetch Exoscale Anti-Affinity Groups data.
Fetch Exoscale Anti-Affinity Groups https://community.exoscale.com/documentation/compute/anti-affinity-groups/ data.
Corresponding resource: exoscaleantiaffinity_group ../resources/anti_affinity_group.md.
---

# exoscale\_anti\_affinity\_group
# exoscale_anti_affinity_group (Data Source)

Fetch Exoscale [Anti-Affinity Groups](https://community.exoscale.com/documentation/compute/anti-affinity-groups/) data.

Corresponding resource: [exoscale_anti_affinity_group](../resources/anti_affinity_group.md).

## Example Usage

## Usage

```hcl
```terraform
data "exoscale_anti_affinity_group" "my_anti_affinity_group" {
name = "my-anti-affinity-group"
}
Expand All @@ -26,15 +28,16 @@ output "my_anti_affinity_group_id" {
Please refer to the [examples](https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples/)
directory for complete configuration examples.

<!-- schema generated by tfplugindocs -->
## Schema

## Arguments Reference
### Optional

* `id` - The anti-affinity group ID to match (conflicts with `name`).
* `name` - The group name to match (conflicts with `id`).
- `id` (String) The anti-affinity group ID to match (conflicts with `name`).
- `name` (String) The group name to match (conflicts with `id`).

### Read-Only

## Attributes Reference
- `instances` (Set of String) The list of attached [exoscale_compute_instance](../resources/compute_instance.md) (IDs).

In addition to the arguments listed above, the following attributes are exported:

* `instances` - The list of attached [exoscale_compute_instance](../resources/compute_instance.md) (IDs).
41 changes: 22 additions & 19 deletions docs/data-sources/compute.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
---
page_title: "Exoscale: exoscale_compute"
page_title: "exoscale_compute Data Source - terraform-provider-exoscale"
subcategory: "Deprecated"
description: |-
Fetch Exoscale Compute Instances data.
---

# exoscale\_compute
# exoscale_compute (Data Source)

!> **WARNING:** This data source is **DEPRECATED** and will be removed in the next major version. Please use [exoscale_compute_instance](./compute_instance.md) instead.

## Arguments Reference

* `id` - The compute instance ID to match.
* `hostname` - The instance hostname to match.
* `tags` - The instance tags to match (map of key/value).

<!-- schema generated by tfplugindocs -->
## Schema

## Attributes Reference
### Optional

In addition to the arguments listed above, the following attributes are exported:
- `hostname` (String) The instance hostname to match.
- `id` (String) The compute instance ID to match.
- `tags` (Map of String) The instance tags to match (map of key/value).

### Read-Only

- `cpu` (Number) Number of cpu the Compute instance is running with
- `created` (String) Date when the Compute instance was created
- `disk_size` (Number) Size of the Compute instance disk
- `ip6_address` (String) Compute instance public ipv6 address (if ipv6 is enabled)
- `ip_address` (String) Compute instance public ipv4 address
- `memory` (Number) Memory allocated for the Compute instance
- `private_network_ip_addresses` (List of String) List of Compute instance private IP addresses (in managed Private Networks only)
- `size` (String) Current size of the Compute instance
- `state` (String) State of the Compute instance
- `template` (String) Name of the template for the Compute instance
- `zone` (String) Name of the availability zone for the Compute instance

* `zone` - Exoscale Zone name.
* `cpu` - The compute instance number of CPUs.
* `created` - The instance creation date.
* `disk_size` - The instance disk size (GiB).
* `ip_address` - The instance (main network interface) IPv4 address.
* `ip6_address` - The instance (main network interface) IPv6 address (if enabled).
* `memory` - The instance allocated memory.
* `size` - The instance size.
* `state` - The current instance state.
* `template` - The instance template.

* `private_network_ip_addresses` - List of compute private IPv4 addresses (in *managed* private networks only).
70 changes: 35 additions & 35 deletions docs/data-sources/compute_instance.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
page_title: "Exoscale: exoscale_compute_instance"
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "exoscale_compute_instance Data Source - terraform-provider-exoscale"
subcategory: ""
description: |-
Fetch Exoscale Compute Instances data.
Fetch Exoscale Compute Instances https://community.exoscale.com/documentation/compute/ data.
Corresponding resource: exoscalecomputeinstance ../resources/compute_instance.md.
---

# exoscale\_compute\_instance
# exoscale_compute_instance (Data Source)

Fetch Exoscale [Compute Instances](https://community.exoscale.com/documentation/compute/) data.

Corresponding resource: [exoscale_compute_instance](../resources/compute_instance.md).

## Example Usage

## Usage

```hcl
```terraform
data "exoscale_compute_instance" "my_instance" {
zone = "ch-gva-2"
name = "my-instance"
Expand All @@ -27,40 +29,38 @@ output "my_instance_id" {
Please refer to the [examples](https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples/)
directory for complete configuration examples.

<!-- schema generated by tfplugindocs -->
## Schema

## Arguments Reference

[zone]: https://www.exoscale.com/datacenters/

* `zone` - (Required) The Exoscale [Zone][zone] name.
### Required

* `id` - The compute instance ID to match (conflicts with `name`).
* `name` - The instance name to match (conflicts with `id`).
- `zone` (String) The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.

### Optional

## Attributes Reference
- `anti_affinity_group_ids` (Set of String) The list of attached [exoscale_anti_affinity_group](../resources/anti_affinity_group.md) (IDs).
- `id` (String) The compute instance ID to match (conflicts with `name`).
- `labels` (Map of String) A map of key/value labels.
- `name` (String) The instance name to match (conflicts with `id`).

[cloud-init]: http://cloudinit.readthedocs.io/en/latest/
### Read-Only

In addition to the arguments listed above, the following attributes are exported:
- `created_at` (String) The compute instance creation date.
- `deploy_target_id` (String) A deploy target ID.
- `disk_size` (Number) The instance disk size (GiB).
- `elastic_ip_ids` (Set of String) The list of attached [exoscale_elastic_ip](../resources/elastic_ip.md) (IDs).
- `ipv6` (Boolean) Whether IPv6 is enabled on the instance.
- `ipv6_address` (String) The instance (main network interface) IPv6 address (if enabled).
- `manager_id` (String) The instance manager ID, if any.
- `manager_type` (String) The instance manager type (instance pool, SKS node pool, etc.), if any.
- `private_network_ids` (Set of String) The list of attached [exoscale_private_network](../resources/private_network.md) (IDs).
- `public_ip_address` (String) The instance (main network interface) IPv4 address.
- `reverse_dns` (String) Domain name for reverse DNS record.
- `security_group_ids` (Set of String) The list of attached [exoscale_security_group](../resources/security_group.md) (IDs).
- `ssh_key` (String) The [exoscale_ssh_key](../resources/ssh_key.md) (name) authorized on the instance.
- `state` (String) The instance state.
- `template_id` (String) The instance [exoscale_compute_template](./compute_template.md) ID.
- `type` (String) The instance type.
- `user_data` (String) The instance [cloud-init](http://cloudinit.readthedocs.io/en/latest/) configuration.

* `created_at` - The compute instance creation date.
* `deploy_target_id` - A deploy target ID.
* `disk_size` - The instance disk size (GiB).
* `ipv6_address` - The instance (main network interface) IPv6 address (if enabled).
* `ipv6` - Whether IPv6 is enabled on the instance.
* `labels` - A map of key/value labels.
* `manager_id` - The instance manager ID, if any.
* `manager_type` - The instance manager type (instance pool, SKS node pool, etc.), if any.
* `public_ip_address` - The instance (main network interface) IPv4 address.
* `reverse_dns` - Domain name for reverse DNS record.
* `ssh_key` - The [exoscale_ssh_key](../resources/ssh_key.md) (name) authorized on the instance.
* `state` - The instance state.
* `template_id` - The instance [exoscale_compute_template](./compute_template.md) ID.
* `type` - The instance type.
* `user_data` - The instance [cloud-init][cloud-init] configuration.

* `affinity_group_ids` - The list of attached [exoscale_anti_affinity_group](../resources/anti_affinity_group.md) (IDs).
* `elastic_ip_ids` - The list of attached [exoscale_elastic_ip](../resources/elastic_ip.md) (IDs).
* `network_ids` - The list of attached [exoscale_private_network](../resources/private_network.md) (IDs).
* `security_group_ids` - The list of attached [exoscale_security_group](../resources/security_group.md) (IDs).
79 changes: 63 additions & 16 deletions docs/data-sources/compute_instance_list.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
page_title: "Exoscale: exoscale_compute_instance_list"
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "exoscale_compute_instance_list Data Source - terraform-provider-exoscale"
subcategory: ""
description: |-
List Exoscale Compute Instances.
List Exoscale Compute Instances https://community.exoscale.com/documentation/compute/.
Corresponding resource: exoscalecomputeinstance ../resources/compute_instance.md.
---

# exoscale\_compute\_instance_list
# exoscale_compute_instance_list (Data Source)

List Exoscale [Compute Instances](https://community.exoscale.com/documentation/compute/).

Corresponding resource: [exoscale_compute_instance](../resources/compute_instance.md).

## Example Usage

## Usage

```hcl
```terraform
data "exoscale_compute_instance_list" "my_compute_instance_list" {
zone = "ch-gva-2"
Expand All @@ -37,15 +39,60 @@ output "my_compute_instance_ids" {
Please refer to the [examples](https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples/)
directory for complete configuration examples.

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `created_at` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `deploy_target_id` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `disk_size` (Number) Match against this int
- `id` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `ipv6` (Boolean) Match against this bool
- `ipv6_address` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `labels` (Map of String) Match against key/values. Keys are matched exactly, while values may be matched as a regex if you supply a string that begins and ends with "/"
- `manager_id` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `manager_type` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `name` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `public_ip_address` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `reverse_dns` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `ssh_key` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `state` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `template_id` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `type` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `user_data` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.
- `zone` (String) Match against this string. If you supply a string that begins and ends with a "/" it will be matched as a regex.

### Read-Only

- `instances` (List of Object) The list of [exoscale_compute_instance](./compute_instance.md). (see [below for nested schema](#nestedatt--instances))

<a id="nestedatt--instances"></a>
### Nested Schema for `instances`

Read-Only:

- `anti_affinity_group_ids` (Set of String)
- `created_at` (String)
- `deploy_target_id` (String)
- `disk_size` (Number)
- `elastic_ip_ids` (Set of String)
- `id` (String)
- `ipv6` (Boolean)
- `ipv6_address` (String)
- `labels` (Map of String)
- `manager_id` (String)
- `manager_type` (String)
- `name` (String)
- `private_network_ids` (Set of String)
- `public_ip_address` (String)
- `reverse_dns` (String)
- `security_group_ids` (Set of String)
- `ssh_key` (String)
- `state` (String)
- `template_id` (String)
- `type` (String)
- `user_data` (String)
- `zone` (String)
Comment on lines +70 to +96
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that for a nested list of objects the plugin generating the docs doesn't include the descriptions. This is unfortunately an issue we can't do much about:
hashicorp/terraform-plugin-docs#28 (comment)


## Arguments Reference

[zone]: https://www.exoscale.com/datacenters/

* `zone` - (Required) The Exoscale [Zone][zone] name.

You may filter instances by any string, bool, int or map[string]string attribute of [exoscale_compute_instance](./compute_instance.md) as in the example above. If you supply a string that begins and ends with a "/" it will be matched as a regex.

## Atributes Reference

* `instances` - The list of [exoscale_compute_instance](./compute_instance.md).
Loading