From f9e9fae87ea4db340b059f379706f66dc49b08e6 Mon Sep 17 00:00:00 2001 From: James Pogran Date: Thu, 15 Aug 2024 05:17:00 -0400 Subject: [PATCH] Rename SchemaForModule to SchemaForStack and enable component references (#1794) * Rename SchemaForModule to SchemaForStack * Bump terraform-schema to `8191b5e` --------- Co-authored-by: Ansgar Mertens --- .changes/unreleased/ENHANCEMENTS-20240815-110018.yaml | 6 ++++++ go.mod | 4 ++-- go.sum | 8 ++++---- internal/features/stacks/decoder/path_reader.go | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 .changes/unreleased/ENHANCEMENTS-20240815-110018.yaml diff --git a/.changes/unreleased/ENHANCEMENTS-20240815-110018.yaml b/.changes/unreleased/ENHANCEMENTS-20240815-110018.yaml new file mode 100644 index 00000000..a7813601 --- /dev/null +++ b/.changes/unreleased/ENHANCEMENTS-20240815-110018.yaml @@ -0,0 +1,6 @@ +kind: ENHANCEMENTS +body: Enable component references +time: 2024-08-15T11:00:18.786903+02:00 +custom: + Issue: "386" + Repository: terraform-schema diff --git a/go.mod b/go.mod index b7af2d9c..2a845635 100644 --- a/go.mod +++ b/go.mod @@ -13,12 +13,12 @@ require ( github.com/hashicorp/go-uuid v1.0.3 github.com/hashicorp/go-version v1.7.0 github.com/hashicorp/hc-install v0.7.0 - github.com/hashicorp/hcl-lang v0.0.0-20240722075100-0f6cd5960306 + github.com/hashicorp/hcl-lang v0.0.0-20240814155600-0ec9d4da3a96 github.com/hashicorp/hcl/v2 v2.21.0 github.com/hashicorp/terraform-exec v0.21.0 github.com/hashicorp/terraform-json v0.22.1 github.com/hashicorp/terraform-registry-address v0.2.3 - github.com/hashicorp/terraform-schema v0.0.0-20240807075038-c2315af9606d + github.com/hashicorp/terraform-schema v0.0.0-20240815085819-8191b5ea830b github.com/mcuadros/go-defaults v1.2.0 github.com/mh-cbon/go-fmt-fail v0.0.0-20160815164508-67765b3fbcb5 github.com/mitchellh/cli v1.1.5 diff --git a/go.sum b/go.sum index 49d41c79..af93e8ec 100644 --- a/go.sum +++ b/go.sum @@ -219,8 +219,8 @@ github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC16 github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/hcl-lang v0.0.0-20240722075100-0f6cd5960306 h1:VQ2epS4r2HtNzKJhJVR8sIHdsMV7L80lCvwJkX02hd0= -github.com/hashicorp/hcl-lang v0.0.0-20240722075100-0f6cd5960306/go.mod h1:4uIIEYVWTw+fDs9LVKy1CPnL6Z0XcLOjmanj7fVCIpE= +github.com/hashicorp/hcl-lang v0.0.0-20240814155600-0ec9d4da3a96 h1:WVwJNemS0Him2WhrRUrc6fO/e49w238IcyKXDYoo71w= +github.com/hashicorp/hcl-lang v0.0.0-20240814155600-0ec9d4da3a96/go.mod h1:4uIIEYVWTw+fDs9LVKy1CPnL6Z0XcLOjmanj7fVCIpE= github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/terraform-exec v0.21.0 h1:uNkLAe95ey5Uux6KJdua6+cv8asgILFVWkd/RG0D2XQ= @@ -229,8 +229,8 @@ github.com/hashicorp/terraform-json v0.22.1 h1:xft84GZR0QzjPVWs4lRUwvTcPnegqlyS7 github.com/hashicorp/terraform-json v0.22.1/go.mod h1:JbWSQCLFSXFFhg42T7l9iJwdGXBYV8fmmD6o/ML4p3A= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= -github.com/hashicorp/terraform-schema v0.0.0-20240807075038-c2315af9606d h1:WDUXglKGEnbQxXYfSfZq2gEjORvinXj1hGbXQrabVJw= -github.com/hashicorp/terraform-schema v0.0.0-20240807075038-c2315af9606d/go.mod h1:k86q3epNJLLo/iHmXVrdjLU84bprKTFW1vxuP4iG07M= +github.com/hashicorp/terraform-schema v0.0.0-20240815085819-8191b5ea830b h1:O9ydkxpz8NmdbCEQEK8qi29tPhExbidBIWGf5Sbicso= +github.com/hashicorp/terraform-schema v0.0.0-20240815085819-8191b5ea830b/go.mod h1:Tc8mlcXI3ulpnC1/Ho4O5DeivcXGfezj0U+igIDE3iA= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hexops/autogold v1.3.1 h1:YgxF9OHWbEIUjhDbpnLhgVsjUDsiHDTyDfy2lrfdlzo= diff --git a/internal/features/stacks/decoder/path_reader.go b/internal/features/stacks/decoder/path_reader.go index fe4d10f9..9d8f1148 100644 --- a/internal/features/stacks/decoder/path_reader.go +++ b/internal/features/stacks/decoder/path_reader.go @@ -91,7 +91,7 @@ func stackPathContext(record *state.StackRecord, stateReader CombinedReader) (*d Filenames: record.Meta.Filenames, } - mergedSchema, err := sm.SchemaForModule(meta) + mergedSchema, err := sm.SchemaForStack(meta) if err != nil { return nil, err }