You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
## Unreleased
2
2
3
+
BUG FIXES:
4
+
*`r/tfe_team_project_access`: Fixes a panic that occurs when the client is configured against an older TFE release, by @sebasslash[1011](https://github.com/hashicorp/terraform-provider-tfe/pull/1011)
5
+
3
6
FEATURES:
4
7
*`d/tfe_organization_membership`: Add `organization_membership_id` attribute, by @laurenolivia[997](https://github.com/hashicorp/terraform-provider-tfe/pull/997)
5
8
*`d/tfe_variable_set`: Add `project_ids` attribute, by @Netra2104[994](https://github.com/hashicorp/terraform-provider-tfe/pull/994)
**Note:** If you are introducing a new resource that is only available at a certain TFE release, you do not need to perform any sort of checks.
6
+
7
+
### Implied Check (Recommended Approach)
8
+
9
+
The simplest solution when a particular attribute is not supported by a given TFE release is a `nil` check. These checks are TFE release agnostic and assume that if a field was not returned by the API, the TFE release does not support it. They are particularly important for fields that are structs, where attempting to dereference a nil pointer causes a panic.
10
+
11
+
You can use this implied checks when:
12
+
13
+
- The field is a pointer
14
+
- When a `null` value is ignored by the API or by go-tfe (see if the struct tag has `omitempty`)
If a resource or attribute is **only** available in Terraform Enterprise, use the go-tfe helper [IsEnterprise()](https://pkg.go.dev/github.com/hashicorp/go-tfe#Client.IsEnterprise) to ensure the client is configured against a TFE instance. This check is derived from the `TFP-AppName` header that Terraform Cloud emits, of which if not present, indicates a Terraform Enterprise installation.
32
+
33
+
```go
34
+
config:= meta.(ConfiguredClient)
35
+
36
+
if config.Client.IsEnterprise() {
37
+
// do something with TFE only behavior
38
+
}
39
+
```
40
+
41
+
### Documentation
42
+
43
+
It is important to communicate with practitioners which resources and fields are supported for a particular TFE release.
44
+
45
+
For a new resource, add the minimum release required to the top level documentation.
46
+
47
+
**Example:**
48
+
49
+
```md
50
+
# my_new_resource
51
+
52
+
Provides a my new resource.
53
+
54
+
~> **NOTE:** Using this resource requires using the provider with Terraform Cloud or an instance of Terraform Enterprise at least as recent as v202302-1.
55
+
```
56
+
57
+
58
+
If an attribute has a TFE release constraint, add a second sentence to the attribute's description:
59
+
60
+
```md
61
+
## Argument Reference
62
+
63
+
The following arguments are supported:
64
+
65
+
* `foo` - (Required) Foo is bar.
66
+
* `bar` - (Optional) Bar is foo.
67
+
* `foobar` - (Optional) Foobar is barfoo. This attribute requires Terraform Cloud or an instance of Terraform Enterprise at least as recent as `v202302-1`.
0 commit comments