Skip to content

Commit

Permalink
feat: generate docs (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
miton18 authored Mar 20, 2023
1 parent 785e544 commit d3a1be7
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ test:

testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m

docs:
tfplugindocs generate
tfplugindocs validate
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ CleverCloud provider allow you to interract with CleverCloud platform.

- `endpoint` (String) CleverCloud API endpoint, default to https://api.clever-cloud.com
- `secret` (String, Sensitive) CleverCloud OAuth1 secret, can be took from clever-tools after login
- `token` (String) CleverCloud OAuth1 token, can be took from clever-tools after login
- `token` (String, Sensitive) CleverCloud OAuth1 token, can be took from clever-tools after login
33 changes: 33 additions & 0 deletions docs/resources/cellar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "clevercloud_cellar Resource - terraform-provider-clevercloud"
subcategory: ""
description: |-
Manage Cellar https://www.clever-cloud.com/doc/deploy/addon/cellar/ product.
See product specification https://www.clever-cloud.com/doc/deploy/addon/cellar/.
---

# clevercloud_cellar (Resource)

Manage [Cellar](https://www.clever-cloud.com/doc/deploy/addon/cellar/) product.

See [product specification](https://www.clever-cloud.com/doc/deploy/addon/cellar/).



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

### Required

- `name` (String) Name of the Cellar
- `region` (String) Geographical region where the data will be stored

### Read-Only

- `host` (String) S3 compatible Cellar endpoint
- `id` (String) Generated unique identifier
- `key_id` (String) Key ID used to authenticate
- `key_secret` (String, Sensitive) Key secret used to authenticate


26 changes: 26 additions & 0 deletions docs/resources/cellar_bucket.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "clevercloud_cellar_bucket Resource - terraform-provider-clevercloud"
subcategory: ""
description: |-
Manage Cellar Bucket https://www.clever-cloud.com/doc/deploy/addon/cellar/ product.
See product specification https://www.clever-cloud.com/doc/deploy/addon/cellar/.
---

# clevercloud_cellar_bucket (Resource)

Manage [Cellar Bucket](https://www.clever-cloud.com/doc/deploy/addon/cellar/) product.

See [product specification](https://www.clever-cloud.com/doc/deploy/addon/cellar/).



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

### Required

- `cellar_id` (String) Cellar's reference
- `id` (String) Name of the bucket


50 changes: 50 additions & 0 deletions docs/resources/php.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "clevercloud_php Resource - terraform-provider-clevercloud"
subcategory: ""
description: |-
Manage PHP https://www.php.net/ applications.
See PHP product https://www.clever-cloud.com/doc/getting-started/by-language/php/ specification.
---

# clevercloud_php (Resource)

Manage [PHP](https://www.php.net/) applications.

See [PHP product](https://www.clever-cloud.com/doc/getting-started/by-language/php/) specification.



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

### Required

- `biggest_flavor` (String) Biggest intance flavor, if different from smallest, enable autoscaling
- `max_instance_count` (Number) Maximum instance count, if different from min value, enable autoscaling
- `min_instance_count` (Number) Minimum instance count
- `name` (String) Application name
- `region` (String) Geographical region where the app will be deployed
- `smallest_flavor` (String) Smallest instance flavor

### Optional

- `additional_vhosts` (List of String) Add custom hostname in addition to the default one, see [documentation](https://www.clever-cloud.com/doc/administrate/domain-names/)
- `app_folder` (String) Folder in which the application is located (inside the git repository)
- `build_flavor` (String) Use dedicated instance with given flavor for build step
- `commit` (String) Deploy application on the given commit/tag
- `description` (String) Application description
- `dev_dependencies` (Boolean) Install development dependencies
- `php_version` (String) PHP version (Default: 7)
- `redirect_https` (Boolean) Redirect client from plain to TLS port
- `redis_sessions` (Boolean) Use a linked Redis instance to store sessions (Default: false)
- `sticky_sessions` (Boolean) Enable sticky sessions, use it when your client sessions are instances scoped
- `webroot` (String) Define the DocumentRoot of your project (default: ".")

### Read-Only

- `deploy_url` (String) Git URL used to push source code
- `id` (String) Unique identifier generated during application creation
- `vhost` (String) Default vhost to access your app


4 changes: 2 additions & 2 deletions docs/resources/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: |-
# clevercloud_postgresql (Resource)

Manage [PostgreSQL](https://www.postgresql.org/) product.

See [product specification](https://www.clever-cloud.com/postgresql-hosting/).


Expand All @@ -30,7 +30,7 @@ See [product specification](https://www.clever-cloud.com/postgresql-hosting/).
- `database` (String) Database name on the PostgreSQL server
- `host` (String) Database host, used to connect to
- `id` (String) Generated unique identifier
- `password` (String, Sensitive) Login password
- `password` (String) Login password
- `port` (Number) Database port
- `user` (String) Login username

Expand Down
6 changes: 6 additions & 0 deletions pkg/provider/resource_cellar_bucket_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var resourceCellarBucketDoc string

func (r ResourceCellarBucket) Schema(_ context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Version: 0,
MarkdownDescription: resourceCellarBucketDoc,
Attributes: map[string]schema.Attribute{
// customer provided
Expand All @@ -30,3 +31,8 @@ func (r ResourceCellarBucket) Schema(_ context.Context, req resource.SchemaReque
},
}
}

// https://developer.hashicorp.com/terraform/plugin/framework/resources/state-upgrade#implementing-state-upgrade-support
func (r ResourceCellarBucket) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader {
return map[int64]resource.StateUpgrader{}
}
6 changes: 6 additions & 0 deletions pkg/provider/resource_cellar_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var resourceCellarDoc string

func (r ResourceCellar) Schema(_ context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Version: 0,
MarkdownDescription: resourceCellarDoc,
Attributes: map[string]schema.Attribute{
// customer provided
Expand All @@ -39,3 +40,8 @@ func (r ResourceCellar) Schema(_ context.Context, req resource.SchemaRequest, re
},
}
}

// https://developer.hashicorp.com/terraform/plugin/framework/resources/state-upgrade#implementing-state-upgrade-support
func (r ResourceCellar) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader {
return map[int64]resource.StateUpgrader{}
}
6 changes: 6 additions & 0 deletions pkg/provider/resource_nodejs_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var nodejsDoc string
func (r ResourceNodeJS) Schema(ctx context.Context, req resource.SchemaRequest, res *resource.SchemaResponse) {

res.Schema = schema.Schema{
Version: 0,
MarkdownDescription: nodejsDoc,
Attributes: attributes.WithRuntimeCommons(map[string]schema.Attribute{
// Node specifique
Expand Down Expand Up @@ -73,3 +74,8 @@ func (r ResourceNodeJS) Schema(ctx context.Context, req resource.SchemaRequest,
}),
}
}

// https://developer.hashicorp.com/terraform/plugin/framework/resources/state-upgrade#implementing-state-upgrade-support
func (r ResourceNodeJS) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader {
return map[int64]resource.StateUpgrader{}
}
6 changes: 6 additions & 0 deletions pkg/provider/resource_php_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var phpDoc string

func (r ResourcePHP) Schema(ctx context.Context, req resource.SchemaRequest, res *resource.SchemaResponse) {
res.Schema = schema.Schema{
Version: 0,
MarkdownDescription: phpDoc,
Attributes: attributes.WithRuntimeCommons(map[string]schema.Attribute{
// PHP specifique
Expand All @@ -66,6 +67,11 @@ func (r ResourcePHP) Schema(ctx context.Context, req resource.SchemaRequest, res
}
}

// https://developer.hashicorp.com/terraform/plugin/framework/resources/state-upgrade#implementing-state-upgrade-support
func (php *PHP) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader {
return map[int64]resource.StateUpgrader{}
}

func (php *PHP) toEnv() map[string]string {
m := map[string]string{}

Expand Down
6 changes: 6 additions & 0 deletions pkg/provider/resource_postgresql_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var resourcePostgresqlDoc string

func (r ResourcePostgreSQL) Schema(_ context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
Version: 0,
MarkdownDescription: resourcePostgresqlDoc,
Attributes: map[string]schema.Attribute{
// customer provided
Expand All @@ -45,3 +46,8 @@ func (r ResourcePostgreSQL) Schema(_ context.Context, req resource.SchemaRequest
},
}
}

// https://developer.hashicorp.com/terraform/plugin/framework/resources/state-upgrade#implementing-state-upgrade-support
func (r ResourcePostgreSQL) UpgradeState(ctx context.Context) map[int64]resource.StateUpgrader {
return map[int64]resource.StateUpgrader{}
}

0 comments on commit d3a1be7

Please sign in to comment.