diff --git a/provisioners/provisioner.go b/provisioners/provisioner.go index 0cd86b99f..332d08c0c 100644 --- a/provisioners/provisioner.go +++ b/provisioners/provisioner.go @@ -1,12 +1,16 @@ package provisioner import ( + "github.com/hashicorp/terraform/config/configschema" "github.com/hashicorp/terraform/tfdiags" "github.com/zclconf/go-cty/cty" ) // Interface is the set of methods required for a resource provisioner plugin. type Interface interface { + // GetSchema returns the schema for the provisioner configuration. + GetSchema() GetSchemaResponse + // ValidateProvisionerConfig allows the provisioner to validate the // configuration values. ValidateProvisionerConfig(ValidateProvisionerConfigRequest) ValidateProvisionerConfigResponse @@ -30,6 +34,14 @@ type Interface interface { Stop() error } +type GetSchemaResponse struct { + // Provisioner contains the schema for this provisioner. + Provisioner *configschema.Block + + // Diagnostics contains any warnings or errors from the method call. + Diagnostics tfdiags.Diagnostics +} + // UIOutput provides the Output method for resource provisioner // plugins to write any output to the UI. //