github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/not-internal/configs/depends_on.go (about)

     1  package configs
     2  
     3  import (
     4  	"github.com/hashicorp/hcl/v2"
     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  }