Skip to content

Commit

Permalink
Allow local references in depends_on (#292)
Browse files Browse the repository at this point in the history
* Bump hcl-lang to 2ce7ad1

* Allow local references in depends_on

* Enable typeless references for local attributes
  • Loading branch information
dbanck authored Nov 3, 2023
1 parent 535af8a commit 8af5a07
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/hc-install v0.6.1
github.com/hashicorp/hcl-lang v0.0.0-20231102085329-caa96d65d15b
github.com/hashicorp/hcl-lang v0.0.0-20231103134808-2ce7ad140f7c
github.com/hashicorp/hcl/v2 v2.19.1
github.com/hashicorp/terraform-exec v0.19.0
github.com/hashicorp/terraform-json v0.17.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mO
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/hc-install v0.6.1 h1:IGxShH7AVhPaSuSJpKtVi/EFORNjO+OYVJJrAtGG2mY=
github.com/hashicorp/hc-install v0.6.1/go.mod h1:0fW3jpg+wraYSnFDJ6Rlie3RvLf1bIqVIkzoon4KoVE=
github.com/hashicorp/hcl-lang v0.0.0-20231102085329-caa96d65d15b h1:j8TNMurAPPN05V2/FXOo16c6RpNKY57ZV7iqwO0vAOc=
github.com/hashicorp/hcl-lang v0.0.0-20231102085329-caa96d65d15b/go.mod h1:f8Trmd1qEAs00+y4etS5uTDqYhU3Z/pxJgzsTwWXWM8=
github.com/hashicorp/hcl-lang v0.0.0-20231103134808-2ce7ad140f7c h1:ppZ7NorEmcV4B7+M9DWd6nQNRSWs55RUebJzYOuAdc0=
github.com/hashicorp/hcl-lang v0.0.0-20231103134808-2ce7ad140f7c/go.mod h1:f8Trmd1qEAs00+y4etS5uTDqYhU3Z/pxJgzsTwWXWM8=
github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI=
github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE=
github.com/hashicorp/terraform-exec v0.19.0 h1:FpqZ6n50Tk95mItTSS9BjeOVUb4eg81SpgVtZNNtFSM=
Expand Down
1 change: 1 addition & 0 deletions internal/schema/0.12/data_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func datasourceBlockSchema(v *version.Version) *schema.BlockSchema {
schema.Reference{OfScopeId: refscope.ModuleScope},
schema.Reference{OfScopeId: refscope.ResourceScope},
schema.Reference{OfScopeId: refscope.VariableScope},
schema.Reference{OfScopeId: refscope.LocalScope},
},
},
IsOptional: true,
Expand Down
5 changes: 3 additions & 2 deletions internal/schema/0.12/locals_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ func localsBlockSchema() *schema.BlockSchema {
schema.StaticStep{Name: "local"},
schema.AttrNameStep{},
},
ScopeId: refscope.LocalScope,
AsExprType: true,
ScopeId: refscope.LocalScope,
AsExprType: true,
AsReference: true,
},
Constraint: schema.AnyExpression{OfType: cty.DynamicPseudoType},
},
Expand Down
1 change: 1 addition & 0 deletions internal/schema/0.12/output_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func outputBlockSchema() *schema.BlockSchema {
schema.Reference{OfScopeId: refscope.ModuleScope},
schema.Reference{OfScopeId: refscope.ResourceScope},
schema.Reference{OfScopeId: refscope.VariableScope},
schema.Reference{OfScopeId: refscope.LocalScope},
},
},
IsOptional: true,
Expand Down
1 change: 1 addition & 0 deletions internal/schema/0.12/resource_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func resourceBlockSchema(v *version.Version) *schema.BlockSchema {
schema.Reference{OfScopeId: refscope.ModuleScope},
schema.Reference{OfScopeId: refscope.ResourceScope},
schema.Reference{OfScopeId: refscope.VariableScope},
schema.Reference{OfScopeId: refscope.LocalScope},
},
},
IsOptional: true,
Expand Down
1 change: 1 addition & 0 deletions internal/schema/0.13/module_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func moduleBlockSchema() *schema.BlockSchema {
schema.Reference{OfScopeId: refscope.ModuleScope},
schema.Reference{OfScopeId: refscope.ResourceScope},
schema.Reference{OfScopeId: refscope.VariableScope},
schema.Reference{OfScopeId: refscope.LocalScope},
},
},
IsOptional: true,
Expand Down
1 change: 1 addition & 0 deletions internal/schema/1.5/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func scopedDataBlock() *schema.BlockSchema {
schema.Reference{OfScopeId: refscope.ModuleScope},
schema.Reference{OfScopeId: refscope.ResourceScope},
schema.Reference{OfScopeId: refscope.VariableScope},
schema.Reference{OfScopeId: refscope.LocalScope},
},
},
IsOptional: true,
Expand Down

0 comments on commit 8af5a07

Please sign in to comment.