diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/configs/depends_on.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/configs/depends_on.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/configs/depends_on.go b/vendor/github.com/hashicorp/terraform/configs/depends_on.go new file mode 100644 index 0000000..b198476 --- /dev/null +++ b/vendor/github.com/hashicorp/terraform/configs/depends_on.go | |||
@@ -0,0 +1,23 @@ | |||
1 | package configs | ||
2 | |||
3 | import ( | ||
4 | "github.com/hashicorp/hcl2/hcl" | ||
5 | ) | ||
6 | |||
7 | func decodeDependsOn(attr *hcl.Attribute) ([]hcl.Traversal, hcl.Diagnostics) { | ||
8 | var ret []hcl.Traversal | ||
9 | exprs, diags := hcl.ExprList(attr.Expr) | ||
10 | |||
11 | for _, expr := range exprs { | ||
12 | expr, shimDiags := shimTraversalInString(expr, false) | ||
13 | diags = append(diags, shimDiags...) | ||
14 | |||
15 | traversal, travDiags := hcl.AbsTraversalForExpr(expr) | ||
16 | diags = append(diags, travDiags...) | ||
17 | if len(traversal) != 0 { | ||
18 | ret = append(ret, traversal) | ||
19 | } | ||
20 | } | ||
21 | |||
22 | return ret, diags | ||
23 | } | ||