Skip to content

Commit

Permalink
feat: update docs structure
Browse files Browse the repository at this point in the history
  • Loading branch information
matthisholleville committed Feb 14, 2022
1 parent 1dcbe8b commit edddf00
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 77 deletions.
47 changes: 16 additions & 31 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,28 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "haproxy Provider"
subcategory: ""
layout: ""
page_title: "Provider: HAProxy"
description: |-
Terraform provider for interacting with HAProxy Dataplane API.
The HAProxy provider provides resources to interact with a HAProxy Dataplane API.
---

# haproxy Provider

```hcl
# Set the required provider and versions
terraform {
required_providers {
haproxy = {
version = "~> 1.0.0"
source = "matthisholleville/haproxy"
}
}
}
# HAProxy Provider

The HAProxy provider provides resources to interact with a HAProxy Dataplane API.

# Configure the haproxy provider
## Example Usage

```terraform
provider "haproxy" {
server_addr = "10.100.0.130:5555"
username = "CHANGE_ME"
password = "CHANGE_ME"
insecure = true
}
server_addr = "localhost:5555" # optionally use HAPROXY_SERVER env var
username = "admin" # optionally use HAPROXY_USERNAME env var
password = "adminpwd" # optionally use HAPROXY_PASSWORD env var
# Create a new entrie in the ratelimit HAProxy Maps file
resource "haproxy_maps" "test" {
map = "ratelimit"
key = "/metrics"
value = "50"
# you may need to allow insecure TLS communications unless you have configured
# certificates for your server
insecure = true # optionally use HAPROXY_INSECURE env var
}
```




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

Expand All @@ -46,4 +31,4 @@ resource "haproxy_maps" "test" {
- **insecure** (Boolean) Scheme for request. If not set, https will be use.
- **password** (String) Password use for authentification
- **server_addr** (String) HAProxy Dataplaneapi server address.
- **username** (String) Username use for authentification
- **username** (String) Username use for authentification
18 changes: 15 additions & 3 deletions docs/resources/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
page_title: "haproxy_frontend Resource - terraform-provider-haproxy"
subcategory: ""
description: |-
Manage HAProxy frontend
haproxy_frontend manage frontend.
---

# haproxy_frontend (Resource)

`haproxy_frontend` manage frontend.

## Example Usage


```terraform
resource "haproxy_frontend" "my-frontend" {
name = "my-frontend"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -88,4 +93,11 @@ Optional:
- **stats_show_node_name** (String) Enable reporting of a host name on the statistics page. https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4.2-stats%20show-node
- **stats_uri_prefix** (String) Enable statistics and define the URI prefix to access them. https://cbonte.github.io/haproxy-dconv/1.8/configuration.html#4.2-stats%20uri

## Import

Import is supported using the following syntax:

```shell
# import from provider configured site
terraform import haproxy_frontend.my-frontend my-frontend
```
20 changes: 17 additions & 3 deletions docs/resources/maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@
page_title: "haproxy_maps Resource - terraform-provider-haproxy"
subcategory: ""
description: |-
Manage runtime map files.
haproxy_maps manage maps.
---

# haproxy_maps (Resource)

`haproxy_maps` manage maps.

## Example Usage


```terraform
resource "haproxy_maps" "my-key" {
map = "ratelimit"
key = "/metrics"
value = "50"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -27,4 +34,11 @@ description: |-
- **id** (String) The ID of this resource.
- **value** (String) Value name. Default value 'defaultValue'

## Import

Import is supported using the following syntax:

```shell
# import from provider configured site
terraform import haproxy_maps.my-key map/test/entrie/my-key
```
4 changes: 0 additions & 4 deletions example/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions example/frontend.tf

This file was deleted.

14 changes: 0 additions & 14 deletions example/provider.tf

This file was deleted.

9 changes: 9 additions & 0 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
provider "haproxy" {
server_addr = "localhost:5555" # optionally use HAPROXY_SERVER env var
username = "admin" # optionally use HAPROXY_USERNAME env var
password = "adminpwd" # optionally use HAPROXY_PASSWORD env var

# you may need to allow insecure TLS communications unless you have configured
# certificates for your server
insecure = true # optionally use HAPROXY_INSECURE env var
}
2 changes: 2 additions & 0 deletions examples/resources/haproxy_frontend/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# import from provider configured site
terraform import haproxy_frontend.my-frontend my-frontend
3 changes: 3 additions & 0 deletions examples/resources/haproxy_frontend/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "haproxy_frontend" "my-frontend" {
name = "my-frontend"
}
2 changes: 2 additions & 0 deletions examples/resources/haproxy_maps/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# import from provider configured site
terraform import haproxy_maps.my-key map/test/entrie/my-key
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource "haproxy_maps" "test" {
resource "haproxy_maps" "my-key" {
map = "ratelimit"
key = "/metrics"
value = "50"
Expand Down
1 change: 1 addition & 0 deletions internal/provider/resource_frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

func resourceFrontend() *schema.Resource {
return &schema.Resource{
Description: "`haproxy_frontend` manage frontend.",
CreateContext: resourceFrontendCreate,
ReadContext: resourceFrontendRead,
UpdateContext: resourceFrontendUpdate,
Expand Down
1 change: 1 addition & 0 deletions internal/provider/resource_maps.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

func resourceMaps() *schema.Resource {
return &schema.Resource{
Description: "`haproxy_maps` manage maps.",
CreateContext: resourceMapsCreate,
ReadContext: resourceMapsRead,
UpdateContext: resourceMapsUpdate,
Expand Down
16 changes: 16 additions & 0 deletions templates/index.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: ""
page_title: "Provider: HAProxy"
description: |-
The HAProxy provider provides resources to interact with a HAProxy Dataplane API.
---

# HAProxy Provider

The HAProxy provider provides resources to interact with a HAProxy Dataplane API.

## Example Usage

{{tffile "examples/provider/provider.tf"}}

{{ .SchemaMarkdown | trimspace }}

0 comments on commit edddf00

Please sign in to comment.