diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..38e8ce7 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,16 @@ +## Related Issue + +Fixes # + +## Description + +In plain English, describe your approach to addressing the issue linked above. For example, if you made a particular design decision, let us know why you chose this path instead of another solution. + + +## Rollback Plan + +- [ ] If a change needs to be reverted, we will roll out an update to the code within 7 days. + +## Changes to Security Controls + +Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 340fec3..2beee95 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Go - uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 with: go-version: ${{ matrix.go }} - name: Go mod download diff --git a/go.mod b/go.mod index b8afe3a..7dfa65d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/terraform-json -go 1.18 +go 1.21 require ( github.com/davecgh/go-spew v1.1.1 @@ -8,7 +8,7 @@ require ( github.com/hashicorp/go-version v1.7.0 github.com/mitchellh/copystructure v1.2.0 github.com/sebdah/goldie v1.0.0 - github.com/zclconf/go-cty v1.16.2 + github.com/zclconf/go-cty v1.16.3 github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b ) diff --git a/go.sum b/go.sum index d8b709c..bb0f3a8 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.16.2 h1:LAJSwc3v81IRBZyUVQDUdZ7hs3SYs9jv0eZJDWHD/70= -github.com/zclconf/go-cty v1.16.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.16.3 h1:osr++gw2T61A8KVYHoQiFbFd1Lh3JOCXc/jFLJXKTxk= +github.com/zclconf/go-cty v1.16.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/schemas.go b/schemas.go index 3073d9d..dad47e7 100644 --- a/schemas.go +++ b/schemas.go @@ -95,6 +95,9 @@ type ProviderSchema struct { // The schemas for resources identities in this provider. ResourceIdentitySchemas map[string]*IdentitySchema `json:"resource_identity_schemas,omitempty"` + + // The schemas for any list resources in this provider. + ListResourceSchemas map[string]*Schema `json:"list_resource_schemas,omitempty"` } // Schema is the JSON representation of a particular schema diff --git a/schemas_test.go b/schemas_test.go index 56d45d3..59b9c7f 100644 --- a/schemas_test.go +++ b/schemas_test.go @@ -28,6 +28,9 @@ func TestProviderSchemasValidate(t *testing.T) { "a provider schema including resource identity schemas is validated": { testDataPath: "testdata/identity/schemas.json", }, + "a provider schema including list resource schemas is validated": { + testDataPath: "testdata/list_resources/schemas.json", + }, } for tn, tc := range cases { diff --git a/testdata/list_resources/schemas.json b/testdata/list_resources/schemas.json new file mode 100644 index 0000000..9edb520 --- /dev/null +++ b/testdata/list_resources/schemas.json @@ -0,0 +1 @@ +{"format_version":"0.1","provider_schemas":{"registry.terraform.io/hashicorp/null":{"provider":{"version":0,"block":{"description_kind":"plain"}},"list_resource_schemas":{"null_resource":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"triggers":{"type":["map","string"],"description_kind":"plain","optional":true}},"description_kind":"plain"}}}}}}