diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/schema.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/schema.go | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/schema.go b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/schema.go new file mode 100644 index 0000000..3af742f --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-config-inspect/tfconfig/schema.go | |||
@@ -0,0 +1,106 @@ | |||
1 | package tfconfig | ||
2 | |||
3 | import ( | ||
4 | "github.com/hashicorp/hcl2/hcl" | ||
5 | ) | ||
6 | |||
7 | var rootSchema = &hcl.BodySchema{ | ||
8 | Blocks: []hcl.BlockHeaderSchema{ | ||
9 | { | ||
10 | Type: "terraform", | ||
11 | LabelNames: nil, | ||
12 | }, | ||
13 | { | ||
14 | Type: "variable", | ||
15 | LabelNames: []string{"name"}, | ||
16 | }, | ||
17 | { | ||
18 | Type: "output", | ||
19 | LabelNames: []string{"name"}, | ||
20 | }, | ||
21 | { | ||
22 | Type: "provider", | ||
23 | LabelNames: []string{"name"}, | ||
24 | }, | ||
25 | { | ||
26 | Type: "resource", | ||
27 | LabelNames: []string{"type", "name"}, | ||
28 | }, | ||
29 | { | ||
30 | Type: "data", | ||
31 | LabelNames: []string{"type", "name"}, | ||
32 | }, | ||
33 | { | ||
34 | Type: "module", | ||
35 | LabelNames: []string{"name"}, | ||
36 | }, | ||
37 | }, | ||
38 | } | ||
39 | |||
40 | var terraformBlockSchema = &hcl.BodySchema{ | ||
41 | Attributes: []hcl.AttributeSchema{ | ||
42 | { | ||
43 | Name: "required_version", | ||
44 | }, | ||
45 | }, | ||
46 | Blocks: []hcl.BlockHeaderSchema{ | ||
47 | { | ||
48 | Type: "required_providers", | ||
49 | }, | ||
50 | }, | ||
51 | } | ||
52 | |||
53 | var providerConfigSchema = &hcl.BodySchema{ | ||
54 | Attributes: []hcl.AttributeSchema{ | ||
55 | { | ||
56 | Name: "version", | ||
57 | }, | ||
58 | { | ||
59 | Name: "alias", | ||
60 | }, | ||
61 | }, | ||
62 | } | ||
63 | |||
64 | var variableSchema = &hcl.BodySchema{ | ||
65 | Attributes: []hcl.AttributeSchema{ | ||
66 | { | ||
67 | Name: "type", | ||
68 | }, | ||
69 | { | ||
70 | Name: "description", | ||
71 | }, | ||
72 | { | ||
73 | Name: "default", | ||
74 | }, | ||
75 | }, | ||
76 | } | ||
77 | |||
78 | var outputSchema = &hcl.BodySchema{ | ||
79 | Attributes: []hcl.AttributeSchema{ | ||
80 | { | ||
81 | Name: "description", | ||
82 | }, | ||
83 | }, | ||
84 | } | ||
85 | |||
86 | var moduleCallSchema = &hcl.BodySchema{ | ||
87 | Attributes: []hcl.AttributeSchema{ | ||
88 | { | ||
89 | Name: "source", | ||
90 | }, | ||
91 | { | ||
92 | Name: "version", | ||
93 | }, | ||
94 | { | ||
95 | Name: "providers", | ||
96 | }, | ||
97 | }, | ||
98 | } | ||
99 | |||
100 | var resourceSchema = &hcl.BodySchema{ | ||
101 | Attributes: []hcl.AttributeSchema{ | ||
102 | { | ||
103 | Name: "provider", | ||
104 | }, | ||
105 | }, | ||
106 | } | ||