Skip to content

Commit

Permalink
Add examples in documentation
Browse files Browse the repository at this point in the history
Co-authored-by: André Ferreira <[email protected]>
  • Loading branch information
wpjunior and andrehck committed Dec 15, 2021
1 parent bdbe518 commit 6a7b505
Show file tree
Hide file tree
Showing 34 changed files with 461 additions and 16 deletions.
27 changes: 26 additions & 1 deletion docs/resources/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,32 @@ description: |-

Tsuru Application


## Example Usage

```terraform
resource "tsuru_app" "my-app" {
name = "sample-app"
description = "app created with terraform"
plan = "c0.1m0.2"
pool = "staging"
platform = "python"
team_owner = "admin"
tags = ["a", "b"]
metadata {
labels = {
"label1" = "1"
"io.tsuru/a" = "2"
}
annotations = {
"annotation" = "value"
"io.gcp/key" = "something"
}
}
restart_on_update = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
12 changes: 11 additions & 1 deletion docs/resources/app_autoscale.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ description: |-

Tsuru Application Autoscale


## Example Usage

```terraform
resource "tsuru_app_autoscale" "web" {
app = tsuru_app.my-app.name
process = "web"
min_units = 3
max_units = 10
cpu_average = "60%"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
9 changes: 8 additions & 1 deletion docs/resources/app_cname.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ description: |-

Tsuru Application CName


## Example Usage

```terraform
resource "tsuru_app_cname" "app-extra-cname" {
app = tsuru_app.my-app.name
hostname = "mydomain.com"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
19 changes: 18 additions & 1 deletion docs/resources/app_env.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ description: |-

Tsuru Application Environment


## Example Usage

```terraform
resource "tsuru_app_env" "env" {
app = tsuru_app.my-app.name
restart_on_update = true
environment_variables = {
"ENV1" = "10"
"ENV2" = "other value"
}
private_environment_variables = {
"SECRET_ENV" = data.google_secret_manager_secret_version.mysecret.secret_data
"SECRET_ENV2" = data.myother-secret-manager.mysecret.value
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
9 changes: 8 additions & 1 deletion docs/resources/app_grant.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ description: |-

Tsuru Application Access Grant


## Example Usage

```terraform
resource "tsuru_app_grant" "app-permissions-team-a" {
app = tsuru_app.my-app.name
team = "colab-team"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
13 changes: 12 additions & 1 deletion docs/resources/app_router.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ description: |-

Tsuru Application Router


## Example Usage

```terraform
resource "tsuru_app_router" "other-router" {
app = tsuru_app.my-app.name
name = "my-router"
options = {
"key" = "value"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
10 changes: 9 additions & 1 deletion docs/resources/app_unit.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ description: |-

Tsuru Application Units


## Example Usage

```terraform
resource "tsuru_app_unit" "other-unit" {
app = tsuru_app.my-app.name
process = "web"
units_count = 20
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
41 changes: 40 additions & 1 deletion docs/resources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,46 @@ description: |-




## Example Usage

```terraform
resource "tsuru_cluster" "test_cluster" {
name = "test_cluster"
tsuru_provisioner = "kubernetes"
default = true
http_proxy = "http://myproxy.io:3128"
kube_config {
cluster {
server = "https://mycluster.local"
tls_server_name = "mycluster.local"
insecure_skip_tls_verify = true
certificate_authority_data = "server-cert"
}
user {
auth_provider {
name = "tsuru"
config = {
"tsuru-flag-01" = "result"
}
}
client_certificate_data = "client-cert"
client_key_data = "client-key"
token = "token"
username = "username"
password = "password"
exec {
api_version = "api-version"
command = "tsuru"
args = ["cluster", "login"]
env {
name = "TSURU_TOKEN"
value = "token"
}
}
}
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
9 changes: 8 additions & 1 deletion docs/resources/cluster_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ description: |-

Resource used to assign pools into clusters


## Example Usage

```terraform
resource "tsuru_cluster_pool" "cluster-pool" {
cluster = "my-pool"
pool = "my-cluster"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
11 changes: 10 additions & 1 deletion docs/resources/plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ description: |-




## Example Usage

```terraform
resource "tsuru_plan" "plan1" {
name = "plan1"
cpu = "1" // or "100m" or "200%"
memory = "1Gi"
default = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
11 changes: 10 additions & 1 deletion docs/resources/pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ description: |-




## Example Usage

```terraform
resource "tsuru_pool" "my-pool" {
name = "my-pool"
labels = {
"my-label" = "value"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
15 changes: 14 additions & 1 deletion docs/resources/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ description: |-




## Example Usage

```terraform
resource "tsuru_router" "test_router" {
name = "test_router"
type = "router"
readiness_gates = ["gate1", "gate2"]
config = <<-EOT
url: "testing"
headers:
"x-my-header": test
EOT
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
19 changes: 18 additions & 1 deletion docs/resources/service_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ description: |-




## Example Usage

```terraform
resource "tsuru_service_instance" "my_reverse_proxy" {
service_name = "rpaasv2"
name = "my-reverse-proxy"
owner = "my-team"
description = "My Reverse Proxy"
pool = "some-pool"
plan = "c2m2"
tags = ["tag_a", "tag_b"]
parameters = {
"value" = "10"
"otherValue" = "false"
}
wait_for_up_status = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
11 changes: 10 additions & 1 deletion docs/resources/service_instance_bind.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ description: |-

Tsuru Service Instance Bind


## Example Usage

```terraform
resource "tsuru_service_instance_bind" "instance_bind" {
service_name = "service01"
service_instance = "my-instance"
app = "app01"
restart_on_update = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
10 changes: 9 additions & 1 deletion docs/resources/service_instance_grant.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ description: |-

Tsuru Service Instance Grant


## Example Usage

```terraform
resource "tsuru_service_instance_grant" "instance_grant" {
service_name = "service01"
service_instance = "my-instance"
team = "mysupport-team"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
14 changes: 13 additions & 1 deletion docs/resources/volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ description: |-

Tsuru Service Volume


## Example Usage

```terraform
resource "tsuru_volume" "volume" {
name = "volume01"
owner = "my-team"
plan = "plan01"
pool = "pool01"
options = {
"key" = "value"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
40 changes: 40 additions & 0 deletions docs/resources/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,47 @@ description: |-



## Example Usage

```terraform
resource "tsuru_webhook" "webhook1" {
name = "webhook1"
description = "my event"
team_owner = "myteam"
event_filter {
target_types = [
"target01",
"target02",
]
target_values = [
"targetvalue01",
"targetvalue02",
]
kind_types = [
"kind_type"
]
kind_names = [
"kind_name"
]
error_only = false
success_only = true
}
url = "http://blah.io/webhook"
proxy_url = "http://myproxy.com"
headers = {
"X-Token" = "my-token"
}
method = "POST"
body = "body-test"
insecure = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
Loading

0 comments on commit 6a7b505

Please sign in to comment.