Skip to content

Commit bee9c9e

Browse files
authored
Merge pull request #11 from TerraformInDepth/more_docs
More documentation updates
2 parents e0422fe + 407752a commit bee9c9e

File tree

7 files changed

+44
-15
lines changed

7 files changed

+44
-15
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
push:
1111
paths-ignore:
1212
- "README.md"
13+
branches:
14+
- main
1315

1416
# Testing only needs permissions to read the repository contents.
1517
permissions:

docs/index.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: |-
66
77
---
88

9-
# mastodon Provider
9+
# Mastodon Provider
1010

1111

1212

@@ -16,16 +16,20 @@ description: |-
1616
provider "mastodon" {
1717
host = "https://mastodon.social"
1818
}
19+
20+
resource "mastodon_post" "example" {
21+
content = "I'm posting to the Fediverse from Terraform!"
22+
}
1923
```
2024

2125
<!-- schema generated by tfplugindocs -->
2226
## Schema
2327

2428
### Optional
2529

26-
- `access_token` (String, Sensitive) Password to use for connecting to the server.
27-
- `client_id` (String) Client ID for Mastodon App.
28-
- `client_secret` (String, Sensitive) Client Secret for Mastodon App.
29-
- `email` (String) Username to connect to the server as.
30-
- `host` (String) Mastodon host to connect to.
31-
- `password` (String, Sensitive) Password to use for connecting to the server.
30+
- `access_token` (String, Sensitive) Password to use for connecting to the server. Can be designated by the `MASTODON_ACCESS_TOKEN` environment variable.
31+
- `client_id` (String) Client ID for Mastodon App. Can be designated by the `MASTODON_CLIENT_ID` environment variable.
32+
- `client_secret` (String, Sensitive) Client Secret for Mastodon App. Can be designated by the `MASTODON_CLIENT_SECRET` environment variable.
33+
- `email` (String) Username to connect to the server as. Can be designated by the `MASTODON_USER_EMAIL` environment variable.
34+
- `host` (String) Mastodon host to connect to. Can be designated by the `MASTODON_HOST` environment variable.
35+
- `password` (String, Sensitive) Password to use for connecting to the server. Can be designated by the `MASTODON_USER_PASSWORD` environment variable.

docs/resources/post.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This resource is used to manage posts on a Mastodon instance.
1414

1515
```terraform
1616
resource "mastodon_post" "example" {
17-
content = "I'm posting!"
17+
content = "What a great day to post to the Fediverse from Terraform!"
1818
}
1919
```
2020

examples/provider/provider.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
provider "mastodon" {
22
host = "https://mastodon.social"
33
}
4+
5+
resource "mastodon_post" "example" {
6+
content = "I'm posting to the Fediverse from Terraform!"
7+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
resource "mastodon_post" "example" {
2-
content = "I'm posting!"
2+
content = "What a great day to post to the Fediverse from Terraform!"
33
}

internal/provider/provider.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,29 @@ func (p *MastodonProvider) Schema(ctx context.Context, req provider.SchemaReques
4646
resp.Schema = schema.Schema{
4747
Attributes: map[string]schema.Attribute{
4848
"host": schema.StringAttribute{
49-
MarkdownDescription: "Mastodon host to connect to.",
49+
MarkdownDescription: "Mastodon host to connect to. Can be designated by the `MASTODON_HOST` environment variable.",
5050
Optional: true,
5151
},
5252
"client_id": schema.StringAttribute{
53-
MarkdownDescription: "Client ID for Mastodon App.",
53+
MarkdownDescription: "Client ID for Mastodon App. Can be designated by the `MASTODON_CLIENT_ID` environment variable.",
5454
Optional: true,
5555
},
5656
"client_secret": schema.StringAttribute{
57-
MarkdownDescription: "Client Secret for Mastodon App.",
57+
MarkdownDescription: "Client Secret for Mastodon App. Can be designated by the `MASTODON_CLIENT_SECRET` environment variable.",
5858
Optional: true,
5959
Sensitive: true,
6060
},
6161
"email": schema.StringAttribute{
62-
MarkdownDescription: "Username to connect to the server as.",
62+
MarkdownDescription: "Username to connect to the server as. Can be designated by the `MASTODON_USER_EMAIL` environment variable.",
6363
Optional: true,
6464
},
6565
"password": schema.StringAttribute{
66-
MarkdownDescription: "Password to use for connecting to the server.",
66+
MarkdownDescription: "Password to use for connecting to the server. Can be designated by the `MASTODON_USER_PASSWORD` environment variable.",
6767
Optional: true,
6868
Sensitive: true,
6969
},
7070
"access_token": schema.StringAttribute{
71-
MarkdownDescription: "Password to use for connecting to the server.",
71+
MarkdownDescription: "Password to use for connecting to the server. Can be designated by the `MASTODON_ACCESS_TOKEN` environment variable.",
7272
Optional: true,
7373
Sensitive: true,
7474
},

templates/index.md.tmpl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "{{.ProviderShortName}} Provider"
4+
subcategory: ""
5+
description: |-
6+
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
7+
---
8+
9+
# Mastodon Provider
10+
11+
{{ .Description | trimspace }}
12+
13+
{{ if .HasExample -}}
14+
## Example Usage
15+
16+
{{tffile .ExampleFile }}
17+
{{- end }}
18+
19+
{{ .SchemaMarkdown | trimspace }}

0 commit comments

Comments
 (0)