diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/lang/data.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/lang/data.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/lang/data.go b/vendor/github.com/hashicorp/terraform/lang/data.go new file mode 100644 index 0000000..80313d6 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/lang/data.go | |||
@@ -0,0 +1,33 @@ | |||
1 | package lang | ||
2 | |||
3 | import ( | ||
4 | "github.com/hashicorp/terraform/addrs" | ||
5 | "github.com/hashicorp/terraform/tfdiags" | ||
6 | "github.com/zclconf/go-cty/cty" | ||
7 | ) | ||
8 | |||
9 | // Data is an interface whose implementations can provide cty.Value | ||
10 | // representations of objects identified by referenceable addresses from | ||
11 | // the addrs package. | ||
12 | // | ||
13 | // This interface will grow each time a new type of reference is added, and so | ||
14 | // implementations outside of the Terraform codebases are not advised. | ||
15 | // | ||
16 | // Each method returns a suitable value and optionally some diagnostics. If the | ||
17 | // returned diagnostics contains errors then the type of the returned value is | ||
18 | // used to construct an unknown value of the same type which is then used in | ||
19 | // place of the requested object so that type checking can still proceed. In | ||
20 | // cases where it's not possible to even determine a suitable result type, | ||
21 | // cty.DynamicVal is returned along with errors describing the problem. | ||
22 | type Data interface { | ||
23 | StaticValidateReferences(refs []*addrs.Reference, self addrs.Referenceable) tfdiags.Diagnostics | ||
24 | |||
25 | GetCountAttr(addrs.CountAttr, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) | ||
26 | GetResourceInstance(addrs.ResourceInstance, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) | ||
27 | GetLocalValue(addrs.LocalValue, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) | ||
28 | GetModuleInstance(addrs.ModuleCallInstance, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) | ||
29 | GetModuleInstanceOutput(addrs.ModuleCallOutput, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) | ||
30 | GetPathAttr(addrs.PathAttr, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) | ||
31 | GetTerraformAttr(addrs.TerraformAttr, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) | ||
32 | GetInputVariable(addrs.InputVariable, tfdiags.SourceRange) (cty.Value, tfdiags.Diagnostics) | ||
33 | } | ||