diff options
author | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
---|---|---|
committer | Nathan Dench <ndenc2@gmail.com> | 2019-05-24 15:16:44 +1000 |
commit | 107c1cdb09c575aa2f61d97f48d8587eb6bada4c (patch) | |
tree | ca7d008643efc555c388baeaf1d986e0b6b3e28c /vendor/github.com/hashicorp/terraform/provisioners/provisioner.go | |
parent | 844b5a68d8af4791755b8f0ad293cc99f5959183 (diff) | |
download | terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.gz terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.tar.zst terraform-provider-statuscake-107c1cdb09c575aa2f61d97f48d8587eb6bada4c.zip |
Upgrade to 0.12
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/provisioners/provisioner.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/provisioners/provisioner.go | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/provisioners/provisioner.go b/vendor/github.com/hashicorp/terraform/provisioners/provisioner.go new file mode 100644 index 0000000..e53c884 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/provisioners/provisioner.go | |||
@@ -0,0 +1,82 @@ | |||
1 | package provisioners | ||
2 | |||
3 | import ( | ||
4 | "github.com/hashicorp/terraform/configs/configschema" | ||
5 | "github.com/hashicorp/terraform/tfdiags" | ||
6 | "github.com/zclconf/go-cty/cty" | ||
7 | ) | ||
8 | |||
9 | // Interface is the set of methods required for a resource provisioner plugin. | ||
10 | type Interface interface { | ||
11 | // GetSchema returns the schema for the provisioner configuration. | ||
12 | GetSchema() GetSchemaResponse | ||
13 | |||
14 | // ValidateProvisionerConfig allows the provisioner to validate the | ||
15 | // configuration values. | ||
16 | ValidateProvisionerConfig(ValidateProvisionerConfigRequest) ValidateProvisionerConfigResponse | ||
17 | |||
18 | // ProvisionResource runs the provisioner with provided configuration. | ||
19 | // ProvisionResource blocks until the execution is complete. | ||
20 | // If the returned diagnostics contain any errors, the resource will be | ||
21 | // left in a tainted state. | ||
22 | ProvisionResource(ProvisionResourceRequest) ProvisionResourceResponse | ||
23 | |||
24 | // Stop is called to interrupt the provisioner. | ||
25 | // | ||
26 | // Stop should not block waiting for in-flight actions to complete. It | ||
27 | // should take any action it wants and return immediately acknowledging it | ||
28 | // has received the stop request. Terraform will not make any further API | ||
29 | // calls to the provisioner after Stop is called. | ||
30 | // | ||
31 | // The error returned, if non-nil, is assumed to mean that signaling the | ||
32 | // stop somehow failed and that the user should expect potentially waiting | ||
33 | // a longer period of time. | ||
34 | Stop() error | ||
35 | |||
36 | // Close shuts down the plugin process if applicable. | ||
37 | Close() error | ||
38 | } | ||
39 | |||
40 | type GetSchemaResponse struct { | ||
41 | // Provisioner contains the schema for this provisioner. | ||
42 | Provisioner *configschema.Block | ||
43 | |||
44 | // Diagnostics contains any warnings or errors from the method call. | ||
45 | Diagnostics tfdiags.Diagnostics | ||
46 | } | ||
47 | |||
48 | // UIOutput provides the Output method for resource provisioner | ||
49 | // plugins to write any output to the UI. | ||
50 | // | ||
51 | // Provisioners may call the Output method multiple times while Apply is in | ||
52 | // progress. It is invalid to call Output after Apply returns. | ||
53 | type UIOutput interface { | ||
54 | Output(string) | ||
55 | } | ||
56 | |||
57 | type ValidateProvisionerConfigRequest struct { | ||
58 | // Config is the complete configuration to be used for the provisioner. | ||
59 | Config cty.Value | ||
60 | } | ||
61 | |||
62 | type ValidateProvisionerConfigResponse struct { | ||
63 | // Diagnostics contains any warnings or errors from the method call. | ||
64 | Diagnostics tfdiags.Diagnostics | ||
65 | } | ||
66 | |||
67 | type ProvisionResourceRequest struct { | ||
68 | // Config is the complete provisioner configuration. | ||
69 | Config cty.Value | ||
70 | |||
71 | // Connection contains any information required to access the resource | ||
72 | // instance. | ||
73 | Connection cty.Value | ||
74 | |||
75 | // UIOutput is used to return output during the Apply operation. | ||
76 | UIOutput UIOutput | ||
77 | } | ||
78 | |||
79 | type ProvisionResourceResponse struct { | ||
80 | // Diagnostics contains any warnings or errors from the method call. | ||
81 | Diagnostics tfdiags.Diagnostics | ||
82 | } | ||