Skip to content

Commit

Permalink
docs/provider: Add resource.UniqueId() common review item for concurr…
Browse files Browse the repository at this point in the history
…ency protection fields such as CallerReference and IdempotencyToken

Reference: #9470
  • Loading branch information
bflad committed Jul 24, 2019
1 parent 87123fb commit 669f05c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ The following resource checks need to be addressed before your contribution can
```
- [ ] __Uses resource.NotFoundError__: Custom errors for missing resources should use [`resource.NotFoundError`](https://godoc.org/github.com/hashicorp/terraform/helper/resource#NotFoundError).
- [ ] __Uses resource.UniqueId()__: API fields for concurrency protection such as `CallerReference` and `IdempotencyToken` should use [`resource.UniqueId()`](https://godoc.org/github.com/hashicorp/terraform/helper/resource#UniqueId). The implementation includes a monotonic counter which is safer for concurrent operations than solutions such as `time.Now()`.
- [ ] __Skips Exists Function__: Implementing a resource `Exists` function is extraneous as it often duplicates resource `Read` functionality. Ensure `d.SetId("")` is used to appropriately trigger resource recreation in the resource `Read` function.
- [ ] __Skips id Attribute__: The `id` attribute is implicit for all Terraform resources and does not need to be defined in the schema.
Expand Down

0 comments on commit 669f05c

Please sign in to comment.