Skip to content

Commit 61f1018

Browse files
committed
Sync open source content 🐝 (from 22d9c1676e660df921df089cc1fafaf1a524a857)
1 parent 965ce1d commit 61f1018

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/terraform/create-terraform.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ resource "petstore_pet" "myPet" {
6969
Speakeasy infers Terraform types from the JSON Schema, focusing on the semantics of the `CREATE` and `UPDATE` requests and responses. No specific Terraform types need to be defined in the OpenAPI document.
7070

7171
1. **Required vs optional:** If a property is required in the `CREATE` request body, it's marked as `Required: true`; otherwise, it's `Optional: true`.
72-
2. **Computed properties:** Properties that appear in a response body but are absent from the `CREATE` request are marked as `Computed: true`. This indicates that Terraform will compute the properties' values.
73-
3. **The `ForceNew` property:** If a property exists in the `CREATE` request but is not present in the `UPDATE` request, it's labeled `ForceNew`.
74-
4. **Enum validation:** When an attribute is defined as an enum, Speakeasy configures a `Validator` for runtime type checks. This ensures that all request properties precisely match one of the enumerated values.
75-
5. **`READ`, `UPDATE`, and `DELETE` dependencies**: Every parameter essential for `READ`, `UPDATE`, or `DELETE` operations must either be part of the `CREATE` API response body or be consistently required in the `CREATE` API request. This ensures that all necessary parameters are available for these operations.
72+
2. **Computed properties:** Properties that appear in a response body but are absent from the `CREATE` request are marked as `Computed: true`. This indicates that the provider may compute or return a value for this property.
73+
3. **Optional and computed together:** When a property has both `Optional: true` and `Computed: true`, either the user or the provider can supply the value. If the user doesn't specify a value, the provider will compute or return one.
74+
4. **The `ForceNew` property:** If a property exists in the `CREATE` request but is not present in the `UPDATE` request, it's labeled `ForceNew`.
75+
5. **Enum validation:** When an attribute is defined as an enum, Speakeasy configures a `Validator` for runtime type checks. This ensures that all request properties precisely match one of the enumerated values.
76+
6. **`READ`, `UPDATE`, and `DELETE` dependencies**: Every parameter essential for `READ`, `UPDATE`, or `DELETE` operations must either be part of the `CREATE` API response body or be consistently required in the `CREATE` API request. This ensures that all necessary parameters are available for these operations.
7677

7778
<Callout title="Tip" >
7879
Use additional `x-speakeasy` [annotations](/docs/terraform) to

0 commit comments

Comments
 (0)