diff --git a/docs/terraform/customize/plan-modification.mdx b/docs/terraform/customize/plan-modification.mdx index 7d7da62c..86fe7375 100644 --- a/docs/terraform/customize/plan-modification.mdx +++ b/docs/terraform/customize/plan-modification.mdx @@ -3,6 +3,8 @@ title: "Plan Modification" description: "Learn how to customize Terraform plan behavior." --- +import { Callout } from "@/mdx/components"; + # Plan Modification ## Custom Attribute Plan Modification @@ -25,7 +27,9 @@ components: x-speakeasy-plan-modifiers: AgeModifier ``` -In this scenario, when Speakeasy next generates the Terraform provider, it will bootstrap a custom plan modifier file, located at `internal/planmodifiers/int64planmodifier/age_modifier.go`, and import the schema configuration wherever `x-speakeasy-plan-modifiers: AgeModifier` is referenced. + + Once you've added the `x-speakeasy-plan-modifiers` extension with a modifier, Speakeasy's next Terraform provider generation will bootstrap a custom plan modifier file. Using the previous YAML snippet as an example, the modifier will be located at `internal/planmodifiers/int64planmodifier/age_modifier.go`, and import the schema configuration wherever `x-speakeasy-plan-modifiers: AgeModifier` is referenced. + The `x-speakeasy-plan-modifiers` extension supports an array of names as well, such as: @@ -37,8 +41,6 @@ x-speakeasy-plan-modifiers: ### Implementation Notes -### Implementation notes - A plan modifier is a type that implements the plan modifier interface defined by the `terraform-plugin-framework`. A unique plan modifier is bootstrapped in the appropriate subfolder for the Terraform type that it is applied to, which is usually one of the following: - `boolplanmodifiers` diff --git a/docs/terraform/customize/validation-dependencies.mdx b/docs/terraform/customize/validation-dependencies.mdx index 009789dc..8861bcf2 100644 --- a/docs/terraform/customize/validation-dependencies.mdx +++ b/docs/terraform/customize/validation-dependencies.mdx @@ -4,6 +4,8 @@ description: | Add custom validation logic and manage attribute dependencies in Terraform providers. --- +import { Callout } from "@/mdx/components"; + # Validation and Dependencies ## Prevent Conflicting Attributes @@ -163,8 +165,9 @@ components: type: integer x-speakeasy-plan-validators: AgeValidator ``` - -In this scenario, when Speakeasy next generates the Terraform provider, it will bootstrap a custom validator file located at `internal/validators/int64validators/age_validator.go`, and import the schema configuration wherever `x-speakeasy-plan-validators: AgeValidator` is referenced. You can modify the validator file to contain your logic. + + Once you've added the `x-speakeasy-plan-validators` extension with a modifier, Speakeasy's next Terraform provider generation will bootstrap a custom validator file. Using the previous YAML snippet as an example, the modifier will be located at `internal/validators/int64validators/age_validator.go`, and import the schema configuration wherever `x-speakeasy-plan-validators: AgeValidator` is referenced. You can modify the validator file to contain your logic. + #### Implementation Notes