Skip to content

Commit dc034f3

Browse files
austinvallebflad
andauthored
website: removed non-sdk best practice documentation (#1170)
* Removed testing page (already added in plugin-testing) * removed other language page * removed versioning page * removed sensitive state page * remove depending on providers * remove naming page * add to title, no removal * update titles * updated wording + link * added callout and modified title/wording in first paragraph * Update website/docs/plugin/sdkv2/best-practices/index.mdx Co-authored-by: Brian Flad <bflad417@gmail.com> --------- Co-authored-by: Brian Flad <bflad417@gmail.com>
1 parent 32e6278 commit dc034f3

File tree

13 files changed

+20
-830
lines changed

13 files changed

+20
-830
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Dependency management is performed by [dependabot](https://docs.github.com/en/co
125125
HashiCorp’s open-source projects have always maintained user-friendly, readable CHANGELOGs that allow practitioners and developers to tell at a glance whether a release should have any effect on them, and to gauge the risk of an upgrade.
126126

127127
We follow Terraform Plugin
128-
[changelog specifications](https://www.terraform.io/plugin/sdkv2/best-practices/versioning#changelog-specification).
128+
[changelog specifications](https://developer.hashicorp.com/terraform/plugin/best-practices/versioning#changelog-specification).
129129

130130
#### Changie Automation Tool
131131
This project uses the [Changie](https://changie.dev/) automation tool for changelog automation.
@@ -136,7 +136,7 @@ After Changie is installed on your local machine, run:
136136
```bash
137137
changie new
138138
```
139-
and choose a `kind` of change corresponding to the Terraform Plugin [changelog categories](https://developer.hashicorp.com/terraform/plugin/sdkv2/best-practices/versioning#categorization)
139+
and choose a `kind` of change corresponding to the Terraform Plugin [changelog categories](https://developer.hashicorp.com/terraform/plugin/best-practices/versioning#categorization)
140140

141141
Fill out the body field following the entry format. Changie will then prompt for a Github issue or pull request number.
142142

website/data/plugin-sdkv2-nav-data.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,37 +113,13 @@
113113
"title": "Best Practices",
114114
"routes": [
115115
{ "title": "Overview", "path": "best-practices" },
116-
{
117-
"title": "Naming",
118-
"path": "best-practices/naming"
119-
},
120-
{
121-
"title": "Depending on Providers",
122-
"path": "best-practices/depending-on-providers"
123-
},
124116
{
125117
"title": "Deprecations, Removals, and Renames",
126118
"path": "best-practices/deprecations"
127119
},
128120
{
129121
"title": "Detecting Drift",
130122
"path": "best-practices/detecting-drift"
131-
},
132-
{
133-
"title": "Handling Sensitive Data",
134-
"path": "best-practices/sensitive-state"
135-
},
136-
{
137-
"title": "Testing Patterns",
138-
"path": "best-practices/testing"
139-
},
140-
{
141-
"title": "Versioning and Changelog",
142-
"path": "best-practices/versioning"
143-
},
144-
{
145-
"title": "Writing Non-Go Providers",
146-
"path": "best-practices/other-languages"
147123
}
148124
]
149125
}

website/docs/plugin/sdkv2/best-practices/depending-on-providers.mdx

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

website/docs/plugin/sdkv2/best-practices/deprecations.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
page_title: 'Plugin Development - Deprecations, Removals, and Renames Best Practices'
2+
page_title: 'Plugin Development - SDKv2 Deprecations, Removals, and Renames Best Practices'
33
description: 'Recommendations for deprecations, removals, and renames.'
44
---
55

66
# Deprecations, Removals, and Renames
77

88
Terraform is trusted for managing many facets of infrastructure across many organizations. Part of that trust is due to consistent versioning guidelines and setting expectations for various levels of upgrades. Ensuring backwards compatibility for all patch and minor releases, potentially in concert with any upcoming major changes, is recommended and supported by the Terraform development framework. This allows operators to iteratively update their Terraform configurations rather than require massive refactoring.
99

10-
This guide is designed to walk through various scenarios where existing Terraform functionality requires future removal, while maintaining backwards compatibility. Further information about the versioning terminology (e.g. `MAJOR`.`MINOR`.`PATCH`) in this guide can be found in [the versioning guidelines documentation](/terraform/plugin/sdkv2/best-practices/versioning).
10+
This guide is designed to walk through various scenarios where existing Terraform functionality requires future removal, while maintaining backwards compatibility. Further information about the versioning terminology (e.g. `MAJOR`.`MINOR`.`PATCH`) in this guide can be found in [the versioning guidelines documentation](/terraform/plugin/best-practices/versioning).
1111

1212
~> **NOTE:** Removals should only ever occur in `MAJOR` version upgrades.
1313

@@ -682,7 +682,7 @@ The recommended process is as follows:
682682
1. Add `DeprecatedMessage` to the schema definition of the existing (now the "old") resource, noting to use the new resource in the message.
683683
1. Add `!> **WARNING:** This resource is deprecated and will be removed in the next major version` to the documentation of the existing (now the "old") resource, noting to use the new resource.
684684
1. Add the new resource to the provider `ResourcesMap`
685-
1. Follow the rest of the procedures in the [Provider Attribute Removal section](#provider-attribute-removal).
685+
1. Follow the rest of the procedures in the [Provider Data Source or Resource Removal section](#provider-data-source-or-resource-removal).
686686

687687
### Example Resource Renaming
688688

@@ -708,7 +708,7 @@ func resourceExampleExistingWidget() *schema.Resource {
708708
}
709709
```
710710

711-
In order to support renaming `example_existing_widget` to `example_new_widget`, this sample can be written as the following to support both attributes simultaneously until the `existing_attribute` is removed:
711+
In order to support renaming `example_existing_widget` to `example_new_widget`, this sample can be written as the following to support both resources simultaneously until the `example_existing_widget` resource is removed:
712712

713713
```go
714714
func Provider() terraform.ResourceProvider {

website/docs/plugin/sdkv2/best-practices/detecting-drift.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
page_title: Plugin Development - Detecting Drift
2+
page_title: Plugin Development - SDKv2 Detecting Drift
33
description: |-
44
"Drift" describes changes to infrastructure outside of Terraform. Learn how
55
to ensure that Terraform detects drift so that users will know when their
Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
---
2-
page_title: Plugin Development - Best Practices
2+
page_title: Plugin Development - SDKv2 Best Practices
33
description: >-
4-
Patterns that ensure a consistent user experience, including naming,
5-
deprecation, beta features, testing, and versioning.
4+
Patterns that ensure a consistent user experience, including deprecation, beta features, and detecting drift.
65
---
76

8-
# Terraform Plugin Best Practices
7+
<Highlight>
8+
9+
This best practices section only contains guidance for plugins built with [Terraform Plugin SDK](/terraform/plugin/sdkv2). More generic best practices that apply to both SDK and [Terraform Plugin Framework](/terraform/plugin/framework) can be found in the [Plugin Development Best Practices](/terraform/plugin/best-practices) section.
10+
11+
</Highlight>
12+
13+
# Terraform SDKv2 Best Practices
914

1015
A key feature of Terraform is its plugin system, which separates the details of
1116
specific vendor APIs from the shared logic for managing state, managing configuration,
@@ -15,16 +20,7 @@ specific cloud provider, allowing each provider to fully support its unique
1520
resources and lifecycles and not settling for the lowest common denominator
1621
across all provider resources of that type (virtual machines, networks,
1722
configuration management systems, et. al). While each provider is unique, over
18-
the years, we accumulated recommended patterns that help ensure a consistent user experience when using Terraform for any given provider. This page describes best practices that generally apply to most
19-
Providers, with a brief description of each, and link to read more.
20-
21-
This section is a work in progress, with more sections to come.
22-
23-
## Naming
24-
25-
[Naming][naming] resources, data sources, and attributes in plugins is how plugin authors
26-
expose their functionality to operators and using patterns common to other plugins
27-
lays the foundation for a good user experience.
23+
the years, we accumulated recommended patterns that help ensure a consistent user experience when using Terraform for any given provider. This page describes best practices that generally apply to most Providers built with the legacy SDK, with a brief description of each, and link to read more.
2824

2925
## Deprecations, Removals, and Renames
3026

@@ -53,30 +49,6 @@ Drift][drift], we cover some best practices to ensure Terraform's statefile is
5349
an accurate reflection of reality, to provide accurate plan and apply
5450
functionality.
5551

56-
## Testing Patterns
57-
58-
Terraform developers are encouraged to write acceptance tests that create real
59-
resource to verify the behavior of plugins, ensuring a reliable and safe
60-
way to manage infrastructure. In [Testing Patterns][testing-patterns] we cover
61-
some basic acceptance tests that almost all resources should have to validate
62-
not only the functionality of the resource, but that the resource behaves as
63-
Terraform would expect.
64-
65-
## Versioning and Changelog
66-
67-
Terraform development serves two distinct audiences: those writing plugin code
68-
and those implementing them. By clearly and consistently allowing operators to
69-
easily understand changes in plugin implementation via version numbering and
70-
documenting those changes, a trust is formed between the two audiences. In
71-
[Versioning and Changelog][versioning] we cover some guidelines when deciding
72-
release versions and how to relay changes through documentation.
73-
74-
[naming]: /terraform/plugin/sdkv2/best-practices/naming
75-
7652
[deprecations]: /terraform/plugin/sdkv2/best-practices/deprecations
7753

7854
[drift]: /terraform/plugin/sdkv2/best-practices/detecting-drift
79-
80-
[testing-patterns]: /terraform/plugin/sdkv2/best-practices/testing
81-
82-
[versioning]: /terraform/plugin/sdkv2/best-practices/versioning

website/docs/plugin/sdkv2/best-practices/naming.mdx

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

website/docs/plugin/sdkv2/best-practices/other-languages.mdx

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

0 commit comments

Comments
 (0)