Skip to content

Commit 3b2f29f

Browse files
authored
Merge branch 'main' into dependabot/go_modules/github.com/yuin/goldmark-1.7.8
2 parents e803354 + f242f7b commit 3b2f29f

File tree

122 files changed

+3548
-2000
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+3548
-2000
lines changed

.changes/0.20.0.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## 0.20.0 (November 06, 2024)
2+
3+
NOTES:
4+
5+
* all: This Go module has been updated to Go 1.22 per the [Go support policy](https://go.dev/doc/devel/release#policy). It is recommended to review the [Go 1.22 release notes](https://go.dev/doc/go1.22) before upgrading. Any consumers building on earlier Go versions may experience errors. ([#400](https://github.com/hashicorp/terraform-plugin-docs/issues/400))
6+
7+
FEATURES:
8+
9+
* generate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415))
10+
* migrate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415))
11+
* validate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415))
12+
13+
BUG FIXES:
14+
15+
* validate: File extension check now runs on `index.*` files instead of just `index.md` files. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413))
16+
* validate: File extension check now specifies the correct valid extensions in the error message. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413))
17+
* validate: Front matter check now runs with the correct options on legacy index files. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413))
18+

.changes/0.20.1.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## 0.20.1 (November 26, 2024)
2+
3+
BUG FIXES:
4+
5+
* validate: Fixed a bug that caused false positive validation errors for resource types that have the same name as the provider. ([#419](https://github.com/hashicorp/terraform-plugin-docs/issues/419))
6+
* generate: Fixed a bug that caused all generated resource documentation to have the same content when the provider has a resource type with the same name as the provider. ([#419](https://github.com/hashicorp/terraform-plugin-docs/issues/419))
7+
* generate: Fixed a bug that would return an error when a static file exists in both `templates` and `docs`, which will now be ignored. ([#421](https://github.com/hashicorp/terraform-plugin-docs/issues/421))
8+

.changes/unreleased/NOTES-20240909-102809.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/ci-changie.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
# Ensure terraform-devex-repos is updated on version changes.
22-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2323
# Ensure terraform-devex-repos is updated on version changes.
2424
- uses: miniscruff/changie-action@6dcc2533cac0495148ed4046c438487e4dceaa23 # v2.0.0
2525
with:

.github/workflows/compliance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
copywrite:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1515
- uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3
1616
- run: copywrite headers --plan
1717
- run: copywrite license --plan

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2929
with:
3030
fetch-depth: 0
3131
# Avoid persisting GITHUB_TOKEN credentials as they take priority over our service account PAT for `git push` operations
@@ -54,7 +54,7 @@ jobs:
5454
runs-on: ubuntu-latest
5555
steps:
5656
- name: Checkout
57-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
57+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5858
with:
5959
fetch-depth: 0
6060
# Default input is the SHA that initially triggered the workflow. As we created a new commit in the previous job,
@@ -79,12 +79,12 @@ jobs:
7979
contents: write # Needed for goreleaser to create GitHub release
8080
issues: write # Needed for goreleaser to close associated milestone
8181
steps:
82-
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
82+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8383
with:
8484
ref: ${{ inputs.versionNumber }}
8585
fetch-depth: 0
8686

87-
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
87+
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
8888
with:
8989
go-version-file: 'go.mod'
9090

@@ -93,7 +93,7 @@ jobs:
9393
cd .changes
9494
sed -e "1{/# /d;}" -e "2{/^$/d;}" ${{ needs.changelog-version.outputs.version }}.md > /tmp/release-notes.txt
9595
96-
- uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
96+
- uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
9797
env:
9898
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9999
with:

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
git config --global core.eol lf
2222
2323
- name: Check out code
24-
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525
- name: Setup Go
26-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
26+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
2727
with:
2828
go-version-file: 'go.mod'
2929
- name: Run linters

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ tfproviderdocsgen
1919
# JetBrains IDEs files
2020
.idea/
2121
*.iws
22+
23+
# VSCode files
24+
.vscode

.vscode/launch.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## 0.20.1 (November 26, 2024)
2+
3+
BUG FIXES:
4+
5+
* validate: Fixed a bug that caused false positive validation errors for resource types that have the same name as the provider. ([#419](https://github.com/hashicorp/terraform-plugin-docs/issues/419))
6+
* generate: Fixed a bug that caused all generated resource documentation to have the same content when the provider has a resource type with the same name as the provider. ([#419](https://github.com/hashicorp/terraform-plugin-docs/issues/419))
7+
* generate: Fixed a bug that would return an error when a static file exists in both `templates` and `docs`, which will now be ignored. ([#421](https://github.com/hashicorp/terraform-plugin-docs/issues/421))
8+
9+
## 0.20.0 (November 06, 2024)
10+
11+
NOTES:
12+
13+
* all: This Go module has been updated to Go 1.22 per the [Go support policy](https://go.dev/doc/devel/release#policy). It is recommended to review the [Go 1.22 release notes](https://go.dev/doc/go1.22) before upgrading. Any consumers building on earlier Go versions may experience errors. ([#400](https://github.com/hashicorp/terraform-plugin-docs/issues/400))
14+
15+
FEATURES:
16+
17+
* generate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415))
18+
* migrate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415))
19+
* validate: Add support for ephemeral resources ([#415](https://github.com/hashicorp/terraform-plugin-docs/issues/415))
20+
21+
BUG FIXES:
22+
23+
* validate: File extension check now runs on `index.*` files instead of just `index.md` files. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413))
24+
* validate: File extension check now specifies the correct valid extensions in the error message. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413))
25+
* validate: Front matter check now runs with the correct options on legacy index files. ([#413](https://github.com/hashicorp/terraform-plugin-docs/issues/413))
26+
127
## 0.19.4 (June 04, 2024)
228

329
NOTES:

README.md

Lines changed: 46 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,13 @@ When you run `tfplugindocs`, by default from the root directory of a provider co
112112
* Generate resource template files, if missing
113113
* Generate data source template files, if missing
114114
* Generate function template files, if missing (Requires Terraform v1.8.0+)
115+
* Generate ephemeral resource template files, if missing (Requires Terraform v1.10.0+)
115116
* Copy all non-template files to the output website directory
117+
118+
> [!NOTE]
119+
>
120+
> Non-template files that already exist in the output website directory will not be overwritten.
121+
116122
* Process all the remaining templates to generate files for the output website directory
117123
118124
For inspiration, you can look at the templates and output of the
@@ -193,16 +199,18 @@ For templates:
193199
194200
> **NOTE:** In the following conventional paths for templates, `<data source name>`, `<resource name>`, and `<function name>` do not include the provider prefix.
195201
196-
| Path | Description |
197-
|-------------------------------------------------------|----------------------------------------|
198-
| `templates/` | Root of templated docs |
199-
| `templates/index.md[.tmpl]` | Docs index page (or template) |
200-
| `templates/data-sources.md[.tmpl]` | Generic data source page (or template) |
201-
| `templates/data-sources/<data source name>.md[.tmpl]` | Data source page (or template) |
202-
| `templates/functions.md[.tmpl]` | Generic function page (or template) |
203-
| `templates/functions/<function name>.md[.tmpl]` | Function page (or template) |
204-
| `templates/resources.md[.tmpl]` | Generic resource page (or template) |
205-
| `templates/resources/<resource name>.md[.tmpl]` | Resource page (or template) |
202+
| Path | Description |
203+
|--------------------------------------------------------------------|-----------------------------------------------|
204+
| `templates/` | Root of templated docs |
205+
| `templates/index.md[.tmpl]` | Docs index page (or template) |
206+
| `templates/data-sources.md[.tmpl]` | Generic data source page (or template) |
207+
| `templates/data-sources/<data source name>.md[.tmpl]` | Data source page (or template) |
208+
| `templates/ephemeral-resources.md[.tmpl]` | Generic ephemeral resource page (or template) |
209+
| `templates/ephemeral-resources/<ephemeral resource name>.md[.tmpl]` | Ephemeral resource page (or template) |
210+
| `templates/functions.md[.tmpl]` | Generic function page (or template) |
211+
| `templates/functions/<function name>.md[.tmpl]` | Function page (or template) |
212+
| `templates/resources.md[.tmpl]` | Generic resource page (or template) |
213+
| `templates/resources/<resource name>.md[.tmpl]` | Resource page (or template) |
206214
207215
Note: the `.tmpl` extension is necessary, for the file to be correctly handled as a template.
208216
@@ -211,14 +219,15 @@ For examples:
211219
> **NOTE:** In the following conventional paths for examples, `<data source name>` and `<resource name>` include the provider prefix as well, but the provider prefix is **NOT** included in`<function name>`.
212220
> For example, the data source [`caller_identity`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) in the `aws` provider would have an "example" conventional path of: `examples/data-sources/aws_caller_identity/data-source.tf`
213221
214-
| Path | Description |
215-
|-----------------------------------------------------------|---------------------------------|
216-
| `examples/` | Root of examples |
217-
| `examples/provider/provider.tf` | Provider example config |
218-
| `examples/data-sources/<data source name>/data-source.tf` | Data source example config |
219-
| `examples/functions/<function name>/function.tf` | Function example config |
220-
| `examples/resources/<resource name>/resource.tf` | Resource example config |
221-
| `examples/resources/<resource name>/import.sh` | Resource example import command |
222+
| Path | Description |
223+
|---------------------------------------------------------------------------|-----------------------------------|
224+
| `examples/` | Root of examples |
225+
| `examples/provider/provider.tf` | Provider example config |
226+
| `examples/data-sources/<data source name>/data-source.tf` | Data source example config |
227+
| `examples/ephemeral-resources/<ephemeral resource>/ephemeral-resource.tf` | Ephemeral resource example config |
228+
| `examples/functions/<function name>/function.tf` | Function example config |
229+
| `examples/resources/<resource name>/resource.tf` | Resource example config |
230+
| `examples/resources/<resource name>/import.sh` | Resource example import command |
222231
223232
#### Migration
224233
@@ -229,25 +238,27 @@ The `migrate` subcommand assumes the following conventional paths for the render
229238
230239
Legacy website directory structure:
231240
232-
| Path | Description |
233-
|-------------------------------------------------------|-----------------------------|
234-
| `website/` | Root of website docs |
235-
| `website/docs/guides` | Root of guides subdirectory |
236-
| `website/docs/index.html.markdown` | Docs index page |
237-
| `website/docs/d/<data source name>.html.markdown` | Data source page |
238-
| `website/docs/functons/<function name>.html.markdown` | Functions page |
239-
| `website/docs/r/<resource name>.html.markdown` | Resource page |
241+
| Path | Description |
242+
|----------------------------------------------------------------------------|-----------------------------|
243+
| `website/` | Root of website docs |
244+
| `website/docs/guides` | Root of guides subdirectory |
245+
| `website/docs/index.html.markdown` | Docs index page |
246+
| `website/docs/d/<data source name>.html.markdown` | Data source page |
247+
| `website/docs/ephemeral-resources/<ephemeral resource name>.html.markdown` | Ephemeral resource page |
248+
| `website/docs/functons/<function name>.html.markdown` | Functions page |
249+
| `website/docs/r/<resource name>.html.markdown` | Resource page |
240250
241251
Docs website directory structure:
242252
243-
| Path | Description |
244-
|------------------------------------------------------|-----------------------------|
245-
| `docs/` | Root of website docs |
246-
| `docs/guides` | Root of guides subdirectory |
247-
| `docs/index.html.markdown` | Docs index page |
248-
| `docs/data-sources/<data source name>.html.markdown` | Data source page |
249-
| `docs/functions/<function name>.html.markdown` | Function page |
250-
| `docs/resources/<resource name>.html.markdown` | Resource page |
253+
| Path | Description |
254+
|--------------------------------------------------------------------|-----------------------------|
255+
| `docs/` | Root of website docs |
256+
| `docs/guides` | Root of guides subdirectory |
257+
| `docs/index.html.markdown` | Docs index page |
258+
| `docs/data-sources/<data source name>.html.markdown` | Data source page |
259+
| `docs/ephemeral-resources/<ephemeral resource name>.html.markdown` | Ephemeral resource page |
260+
| `docs/functions/<function name>.html.markdown` | Function page |
261+
| `docs/resources/<resource name>.html.markdown` | Resource page |
251262
252263
Files named `index` (before the first `.`) in the website docs root directory and files in the `website/docs/d/`, `website/docs/r/`, `docs/data-sources/`,
253264
and `docs/resources/` subdirectories will be converted to `tfplugindocs` templates.
@@ -275,7 +286,7 @@ using the following data fields and functions:
275286
| `.RenderedProviderName` | string | Value provided via argument `--rendered-provider-name`, otherwise same as `.ProviderName` |
276287
| `.SchemaMarkdown` | string | a Markdown formatted Provider Schema definition |
277288
278-
##### Resources / Data Source Fields
289+
##### Managed Resource / Ephemeral Resource / Data Source Fields
279290
280291
| Field | Type | Description |
281292
|------------------------:|:------:|-------------------------------------------------------------------------------------------|

cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_generic_templates.txtar

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ resource "scaffolding_example" fallback template exists, creating template
2626
generating missing data source content
2727
data-source "scaffolding_example" fallback template exists, creating template
2828
generating missing function content
29+
generating missing ephemeral resource content
2930
generating missing provider content
3031
provider "terraform-provider-scaffolding" template exists, skipping
3132
rendering static website

cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_named_templates.txtar

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ resource "scaffolding_example" template exists, skipping
2626
generating missing data source content
2727
data-source "scaffolding_example" template exists, skipping
2828
generating missing function content
29+
generating missing ephemeral resource content
2930
generating missing provider content
3031
provider "terraform-provider-scaffolding" template exists, skipping
3132
rendering static website

cmd/tfplugindocs/testdata/scripts/provider-build/generate/framework_provider_success_no_templates.txtar

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ generating new template for "scaffolding_example"
2424
generating missing data source content
2525
generating new template for data-source "scaffolding_example"
2626
generating missing function content
27+
generating missing ephemeral resource content
2728
generating missing provider content
2829
generating new template for "terraform-provider-scaffolding"
2930
rendering static website

cmd/tfplugindocs/testdata/scripts/provider-build/generate/null_provider_success.txtar

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ resource "null_resource" fallback template exists, creating template
2323
generating missing data source content
2424
data-source "null_data_source" fallback template exists, creating template
2525
generating missing function content
26+
generating missing ephemeral resource content
2627
generating missing provider content
2728
provider "terraform-provider-null" template exists, skipping
2829
rendering static website

0 commit comments

Comments
 (0)