From 13fef5f029a16671fc9ad14771dfe237251b8541 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 10:06:45 +0000 Subject: [PATCH 01/14] Bump github.com/zclconf/go-cty from 1.13.0 to 1.13.1 (#77) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.13.0 to 1.13.1. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.13.0...v1.13.1) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 95c4c51..59fefac 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/mitchellh/copystructure v1.2.0 github.com/sebdah/goldie v1.0.0 - github.com/zclconf/go-cty v1.13.0 + github.com/zclconf/go-cty v1.13.1 github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b ) diff --git a/go.sum b/go.sum index f603ec9..0f73786 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.13.0 h1:It5dfKTTZHe9aeppbNOda3mN7Ag7sg6QkBNm6TkyFa0= -github.com/zclconf/go-cty v1.13.0/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/zclconf/go-cty v1.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc= +github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= 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= From 98b86088384ac2de04078e4a55950ecedb116b1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 11:35:57 +0000 Subject: [PATCH 02/14] Bump actions/checkout from 3.3.0 to 3.4.0 (#78) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.3.0 to 3.4.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/ac593985615ec2ede58e132d2e21d2b1cbd6127c...24cb9080177205b6e8c946b17badbe402adc938f) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf92145..6d81567 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: - "1.20" steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # https://github.com/actions/checkout/releases/tag/v3.3.0 + uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # https://github.com/actions/checkout/releases/tag/v3.4.0 - name: Set up Go uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # https://github.com/actions/setup-go/releases/tag/v3.5.0 with: From 3c7ce84404eb7e0ac9e52e8dec4bde7d17831698 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 11:36:21 +0000 Subject: [PATCH 03/14] Bump actions/setup-go from 3.5.0 to 4.0.0 (#79) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.5.0 to 4.0.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/6edd4406fa81c3da01a34fa6f6343087c207a568...4d34df0c2316fe8122ab82dc22947d607c0c91f9) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d81567..38129d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,7 +32,7 @@ jobs: - name: Checkout uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # https://github.com/actions/checkout/releases/tag/v3.4.0 - name: Set up Go - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # https://github.com/actions/setup-go/releases/tag/v3.5.0 + uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # https://github.com/actions/setup-go/releases/tag/v4.0.0 with: go-version: ${{ matrix.go }} - name: Go mod download From 8ef946ebcb6fe4ae1e67a919d89b5f74ee3d0aee Mon Sep 17 00:00:00 2001 From: "hashicorp-copywrite[bot]" <110428419+hashicorp-copywrite[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 16:16:30 +0000 Subject: [PATCH 04/14] [COMPLIANCE] Add Copyright and License Headers --- action.go | 3 +++ cmd/round-trip-dumper/main.go | 3 +++ config.go | 3 +++ config_test.go | 3 +++ expression.go | 3 +++ expression_test.go | 3 +++ metadata.go | 3 +++ metadata_test.go | 3 +++ parse_test.go | 3 +++ plan.go | 3 +++ plan_test.go | 3 +++ sanitize/copy.go | 3 +++ sanitize/copy_test.go | 3 +++ sanitize/sanitize_change.go | 3 +++ sanitize/sanitize_change_test.go | 3 +++ sanitize/sanitize_plan.go | 3 +++ sanitize/sanitize_plan_test.go | 3 +++ sanitize/sanitize_plan_variables.go | 3 +++ sanitize/sanitize_plan_variables_test.go | 3 +++ sanitize/sanitize_state.go | 3 +++ sanitize/sanitize_state_test.go | 3 +++ schemas.go | 3 +++ schemas_test.go | 3 +++ state.go | 3 +++ state_test.go | 3 +++ testdata/013_module_depends_on/main.tf | 3 +++ testdata/110_basic/foo/main.tf | 3 +++ testdata/110_basic/module.tf | 3 +++ testdata/110_basic/outputs.tf | 3 +++ testdata/110_basic/providers.tf | 3 +++ testdata/110_basic/resources.tf | 3 +++ testdata/110_basic/variables.tf | 3 +++ testdata/110_sensitive_values/foo/main.tf | 3 +++ testdata/110_sensitive_values/module.tf | 3 +++ testdata/110_sensitive_values/outputs.tf | 3 +++ testdata/110_sensitive_values/providers.tf | 3 +++ testdata/110_sensitive_values/resources.tf | 3 +++ testdata/110_sensitive_values/variables.tf | 3 +++ testdata/120_basic/foo/main.tf | 3 +++ testdata/120_basic/module.tf | 3 +++ testdata/120_basic/outputs.tf | 3 +++ testdata/120_basic/providers.tf | 3 +++ testdata/120_basic/resources.tf | 3 +++ testdata/120_basic/variables.tf | 3 +++ testdata/basic/foo/main.tf | 3 +++ testdata/basic/module.tf | 3 +++ testdata/basic/outputs.tf | 3 +++ testdata/basic/providers.tf | 3 +++ testdata/basic/resources.tf | 3 +++ testdata/basic/variables.tf | 3 +++ testdata/config_resource_depends_on/main.tf | 3 +++ testdata/deep_module/foo/bar/main.tf | 3 +++ testdata/deep_module/foo/main.tf | 3 +++ testdata/deep_module/main.tf | 3 +++ testdata/explicit_null/main.tf | 3 +++ testdata/explicit_null/terraform.tfvars | 3 +++ testdata/has_changes/foo/main.tf | 3 +++ testdata/has_changes/module.tf | 3 +++ testdata/has_changes/outputs.tf | 3 +++ testdata/has_changes/providers.tf | 3 +++ testdata/has_changes/resources.tf | 3 +++ testdata/has_changes/variables.tf | 3 +++ testdata/nested_config_keys/main.tf | 3 +++ testdata/no_changes/foo/main.tf | 3 +++ testdata/no_changes/module.tf | 3 +++ testdata/no_changes/outputs.tf | 3 +++ testdata/no_changes/providers.tf | 3 +++ testdata/no_changes/resources.tf | 3 +++ testdata/no_changes/variables.tf | 3 +++ testdata/output_depends_on/main.tf | 3 +++ testdata/provider_version/main.tf | 3 +++ testdata/registry_module/main.tf | 3 +++ tfjson.go | 3 +++ validate.go | 3 +++ validate_test.go | 3 +++ version.go | 3 +++ version_test.go | 3 +++ 77 files changed, 231 insertions(+) diff --git a/action.go b/action.go index 51c4c83..c74f7e6 100644 --- a/action.go +++ b/action.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson // Action is a valid action type for a resource change. diff --git a/cmd/round-trip-dumper/main.go b/cmd/round-trip-dumper/main.go index b07e404..92c2270 100644 --- a/cmd/round-trip-dumper/main.go +++ b/cmd/round-trip-dumper/main.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package main import ( diff --git a/config.go b/config.go index 5ebe4bc..e8ea638 100644 --- a/config.go +++ b/config.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/config_test.go b/config_test.go index 1cd17fa..c0cf1e0 100644 --- a/config_test.go +++ b/config_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/expression.go b/expression.go index 8a39fac..5ecb15c 100644 --- a/expression.go +++ b/expression.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import "encoding/json" diff --git a/expression_test.go b/expression_test.go index aea1eea..1fb74ef 100644 --- a/expression_test.go +++ b/expression_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/metadata.go b/metadata.go index 70d7ce4..eb52577 100644 --- a/metadata.go +++ b/metadata.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/metadata_test.go b/metadata_test.go index 1bc0072..9938a09 100644 --- a/metadata_test.go +++ b/metadata_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/parse_test.go b/parse_test.go index 78495ef..79c9a66 100644 --- a/parse_test.go +++ b/parse_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/plan.go b/plan.go index 6cfd533..cbbf186 100644 --- a/plan.go +++ b/plan.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/plan_test.go b/plan_test.go index 003e966..c74826d 100644 --- a/plan_test.go +++ b/plan_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/sanitize/copy.go b/sanitize/copy.go index 27991fd..01913a1 100644 --- a/sanitize/copy.go +++ b/sanitize/copy.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/sanitize/copy_test.go b/sanitize/copy_test.go index 63bff6c..be7d6a4 100644 --- a/sanitize/copy_test.go +++ b/sanitize/copy_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/sanitize/sanitize_change.go b/sanitize/sanitize_change.go index 3396438..086cca1 100644 --- a/sanitize/sanitize_change.go +++ b/sanitize/sanitize_change.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/sanitize/sanitize_change_test.go b/sanitize/sanitize_change_test.go index 775a1f4..0741b2a 100644 --- a/sanitize/sanitize_change_test.go +++ b/sanitize/sanitize_change_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/sanitize/sanitize_plan.go b/sanitize/sanitize_plan.go index 6d009f0..d03b8fa 100644 --- a/sanitize/sanitize_plan.go +++ b/sanitize/sanitize_plan.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/sanitize/sanitize_plan_test.go b/sanitize/sanitize_plan_test.go index 18ad5c3..9506423 100644 --- a/sanitize/sanitize_plan_test.go +++ b/sanitize/sanitize_plan_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/sanitize/sanitize_plan_variables.go b/sanitize/sanitize_plan_variables.go index 7d86a12..b800ebb 100644 --- a/sanitize/sanitize_plan_variables.go +++ b/sanitize/sanitize_plan_variables.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/sanitize/sanitize_plan_variables_test.go b/sanitize/sanitize_plan_variables_test.go index 19164ce..482b181 100644 --- a/sanitize/sanitize_plan_variables_test.go +++ b/sanitize/sanitize_plan_variables_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/sanitize/sanitize_state.go b/sanitize/sanitize_state.go index 3aba29b..e1fe1a7 100644 --- a/sanitize/sanitize_state.go +++ b/sanitize/sanitize_state.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/sanitize/sanitize_state_test.go b/sanitize/sanitize_state_test.go index 7ca194a..ac7d501 100644 --- a/sanitize/sanitize_state_test.go +++ b/sanitize/sanitize_state_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package sanitize import ( diff --git a/schemas.go b/schemas.go index f7c8abd..64f87d8 100644 --- a/schemas.go +++ b/schemas.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/schemas_test.go b/schemas_test.go index a02ffba..5044559 100644 --- a/schemas_test.go +++ b/schemas_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/state.go b/state.go index 3c3f6a4..02f0dc6 100644 --- a/state.go +++ b/state.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/state_test.go b/state_test.go index c1b9fa4..dee9021 100644 --- a/state_test.go +++ b/state_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/testdata/013_module_depends_on/main.tf b/testdata/013_module_depends_on/main.tf index 5142ecf..69bbfad 100644 --- a/testdata/013_module_depends_on/main.tf +++ b/testdata/013_module_depends_on/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "foo" { source = "vancluever/module/null" diff --git a/testdata/110_basic/foo/main.tf b/testdata/110_basic/foo/main.tf index 6c96638..c982366 100644 --- a/testdata/110_basic/foo/main.tf +++ b/testdata/110_basic/foo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { null = { diff --git a/testdata/110_basic/module.tf b/testdata/110_basic/module.tf index 26a3ebe..748acf8 100644 --- a/testdata/110_basic/module.tf +++ b/testdata/110_basic/module.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "foo" { source = "./foo" diff --git a/testdata/110_basic/outputs.tf b/testdata/110_basic/outputs.tf index 1e2a453..c2d5312 100644 --- a/testdata/110_basic/outputs.tf +++ b/testdata/110_basic/outputs.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "foo" { sensitive = true value = "bar" diff --git a/testdata/110_basic/providers.tf b/testdata/110_basic/providers.tf index e2b7d2e..ff1a6f2 100644 --- a/testdata/110_basic/providers.tf +++ b/testdata/110_basic/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { null = { diff --git a/testdata/110_basic/resources.tf b/testdata/110_basic/resources.tf index d0d408a..8b56d9b 100644 --- a/testdata/110_basic/resources.tf +++ b/testdata/110_basic/resources.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/110_basic/variables.tf b/testdata/110_basic/variables.tf index 3964e7a..3aaf377 100644 --- a/testdata/110_basic/variables.tf +++ b/testdata/110_basic/variables.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/110_sensitive_values/foo/main.tf b/testdata/110_sensitive_values/foo/main.tf index 7e23c1e..9d5bbd8 100644 --- a/testdata/110_sensitive_values/foo/main.tf +++ b/testdata/110_sensitive_values/foo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "bar" { type = string } diff --git a/testdata/110_sensitive_values/module.tf b/testdata/110_sensitive_values/module.tf index 26a3ebe..748acf8 100644 --- a/testdata/110_sensitive_values/module.tf +++ b/testdata/110_sensitive_values/module.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "foo" { source = "./foo" diff --git a/testdata/110_sensitive_values/outputs.tf b/testdata/110_sensitive_values/outputs.tf index 1e2a453..c2d5312 100644 --- a/testdata/110_sensitive_values/outputs.tf +++ b/testdata/110_sensitive_values/outputs.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "foo" { sensitive = true value = "bar" diff --git a/testdata/110_sensitive_values/providers.tf b/testdata/110_sensitive_values/providers.tf index 502945b..23ef26c 100644 --- a/testdata/110_sensitive_values/providers.tf +++ b/testdata/110_sensitive_values/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { null = { diff --git a/testdata/110_sensitive_values/resources.tf b/testdata/110_sensitive_values/resources.tf index d0d408a..8b56d9b 100644 --- a/testdata/110_sensitive_values/resources.tf +++ b/testdata/110_sensitive_values/resources.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/110_sensitive_values/variables.tf b/testdata/110_sensitive_values/variables.tf index 3964e7a..3aaf377 100644 --- a/testdata/110_sensitive_values/variables.tf +++ b/testdata/110_sensitive_values/variables.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/120_basic/foo/main.tf b/testdata/120_basic/foo/main.tf index 6c96638..c982366 100644 --- a/testdata/120_basic/foo/main.tf +++ b/testdata/120_basic/foo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { null = { diff --git a/testdata/120_basic/module.tf b/testdata/120_basic/module.tf index 26a3ebe..748acf8 100644 --- a/testdata/120_basic/module.tf +++ b/testdata/120_basic/module.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "foo" { source = "./foo" diff --git a/testdata/120_basic/outputs.tf b/testdata/120_basic/outputs.tf index 1e2a453..c2d5312 100644 --- a/testdata/120_basic/outputs.tf +++ b/testdata/120_basic/outputs.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "foo" { sensitive = true value = "bar" diff --git a/testdata/120_basic/providers.tf b/testdata/120_basic/providers.tf index e2b7d2e..ff1a6f2 100644 --- a/testdata/120_basic/providers.tf +++ b/testdata/120_basic/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + terraform { required_providers { null = { diff --git a/testdata/120_basic/resources.tf b/testdata/120_basic/resources.tf index d0d408a..8b56d9b 100644 --- a/testdata/120_basic/resources.tf +++ b/testdata/120_basic/resources.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/120_basic/variables.tf b/testdata/120_basic/variables.tf index 3964e7a..3aaf377 100644 --- a/testdata/120_basic/variables.tf +++ b/testdata/120_basic/variables.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/basic/foo/main.tf b/testdata/basic/foo/main.tf index 8c48a85..ffa6741 100644 --- a/testdata/basic/foo/main.tf +++ b/testdata/basic/foo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "bar" { type = "string" } diff --git a/testdata/basic/module.tf b/testdata/basic/module.tf index 236fdac..0093efe 100644 --- a/testdata/basic/module.tf +++ b/testdata/basic/module.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "foo" { source = "./foo" diff --git a/testdata/basic/outputs.tf b/testdata/basic/outputs.tf index 1e2a453..c2d5312 100644 --- a/testdata/basic/outputs.tf +++ b/testdata/basic/outputs.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "foo" { sensitive = true value = "bar" diff --git a/testdata/basic/providers.tf b/testdata/basic/providers.tf index 4d48120..121e8e7 100644 --- a/testdata/basic/providers.tf +++ b/testdata/basic/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + provider "null" {} provider "aws" { diff --git a/testdata/basic/resources.tf b/testdata/basic/resources.tf index 1d4a8e8..2584f74 100644 --- a/testdata/basic/resources.tf +++ b/testdata/basic/resources.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/basic/variables.tf b/testdata/basic/variables.tf index 3964e7a..3aaf377 100644 --- a/testdata/basic/variables.tf +++ b/testdata/basic/variables.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/config_resource_depends_on/main.tf b/testdata/config_resource_depends_on/main.tf index 4eede79..aeb2abb 100644 --- a/testdata/config_resource_depends_on/main.tf +++ b/testdata/config_resource_depends_on/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + resource "null_resource" "foo" {} resource "null_resource" "bar" { diff --git a/testdata/deep_module/foo/bar/main.tf b/testdata/deep_module/foo/bar/main.tf index 87b7dc3..ca0b1cd 100644 --- a/testdata/deep_module/foo/bar/main.tf +++ b/testdata/deep_module/foo/bar/main.tf @@ -1 +1,4 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + resource "null_resource" "baz" {} diff --git a/testdata/deep_module/foo/main.tf b/testdata/deep_module/foo/main.tf index 88d61ea..7ed7c97 100644 --- a/testdata/deep_module/foo/main.tf +++ b/testdata/deep_module/foo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "bar" { source = "./bar" } diff --git a/testdata/deep_module/main.tf b/testdata/deep_module/main.tf index 9ae1dbe..0227248 100644 --- a/testdata/deep_module/main.tf +++ b/testdata/deep_module/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "foo" { source = "./foo" } diff --git a/testdata/explicit_null/main.tf b/testdata/explicit_null/main.tf index 0970874..0e91c13 100644 --- a/testdata/explicit_null/main.tf +++ b/testdata/explicit_null/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "one" { type = "string" } diff --git a/testdata/explicit_null/terraform.tfvars b/testdata/explicit_null/terraform.tfvars index 6180694..3d12b95 100644 --- a/testdata/explicit_null/terraform.tfvars +++ b/testdata/explicit_null/terraform.tfvars @@ -1 +1,4 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + one = "two" diff --git a/testdata/has_changes/foo/main.tf b/testdata/has_changes/foo/main.tf index f3d0b00..bb2a83c 100644 --- a/testdata/has_changes/foo/main.tf +++ b/testdata/has_changes/foo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "bar" { type = "string" } diff --git a/testdata/has_changes/module.tf b/testdata/has_changes/module.tf index 236fdac..0093efe 100644 --- a/testdata/has_changes/module.tf +++ b/testdata/has_changes/module.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "foo" { source = "./foo" diff --git a/testdata/has_changes/outputs.tf b/testdata/has_changes/outputs.tf index 1e2a453..c2d5312 100644 --- a/testdata/has_changes/outputs.tf +++ b/testdata/has_changes/outputs.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "foo" { sensitive = true value = "bar" diff --git a/testdata/has_changes/providers.tf b/testdata/has_changes/providers.tf index 4d48120..121e8e7 100644 --- a/testdata/has_changes/providers.tf +++ b/testdata/has_changes/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + provider "null" {} provider "aws" { diff --git a/testdata/has_changes/resources.tf b/testdata/has_changes/resources.tf index 1d4a8e8..2584f74 100644 --- a/testdata/has_changes/resources.tf +++ b/testdata/has_changes/resources.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/has_changes/variables.tf b/testdata/has_changes/variables.tf index 3964e7a..3aaf377 100644 --- a/testdata/has_changes/variables.tf +++ b/testdata/has_changes/variables.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/nested_config_keys/main.tf b/testdata/nested_config_keys/main.tf index 4a43a15..d9d3000 100644 --- a/testdata/nested_config_keys/main.tf +++ b/testdata/nested_config_keys/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + provider "aws" { region = "us-east-1" } diff --git a/testdata/no_changes/foo/main.tf b/testdata/no_changes/foo/main.tf index f3d0b00..bb2a83c 100644 --- a/testdata/no_changes/foo/main.tf +++ b/testdata/no_changes/foo/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "bar" { type = "string" } diff --git a/testdata/no_changes/module.tf b/testdata/no_changes/module.tf index 236fdac..0093efe 100644 --- a/testdata/no_changes/module.tf +++ b/testdata/no_changes/module.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "foo" { source = "./foo" diff --git a/testdata/no_changes/outputs.tf b/testdata/no_changes/outputs.tf index 1e2a453..c2d5312 100644 --- a/testdata/no_changes/outputs.tf +++ b/testdata/no_changes/outputs.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + output "foo" { sensitive = true value = "bar" diff --git a/testdata/no_changes/providers.tf b/testdata/no_changes/providers.tf index 4d48120..121e8e7 100644 --- a/testdata/no_changes/providers.tf +++ b/testdata/no_changes/providers.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + provider "null" {} provider "aws" { diff --git a/testdata/no_changes/resources.tf b/testdata/no_changes/resources.tf index 1d4a8e8..2584f74 100644 --- a/testdata/no_changes/resources.tf +++ b/testdata/no_changes/resources.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/no_changes/variables.tf b/testdata/no_changes/variables.tf index 3964e7a..3aaf377 100644 --- a/testdata/no_changes/variables.tf +++ b/testdata/no_changes/variables.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/output_depends_on/main.tf b/testdata/output_depends_on/main.tf index c3dc56c..88b1b84 100644 --- a/testdata/output_depends_on/main.tf +++ b/testdata/output_depends_on/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + resource "null_resource" "foo" {} resource "null_resource" "bar" {} diff --git a/testdata/provider_version/main.tf b/testdata/provider_version/main.tf index 8200c58..1f96cf8 100644 --- a/testdata/provider_version/main.tf +++ b/testdata/provider_version/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + provider "null" { version = "~> 2.1" } diff --git a/testdata/registry_module/main.tf b/testdata/registry_module/main.tf index f512d2c..c8c05d8 100644 --- a/testdata/registry_module/main.tf +++ b/testdata/registry_module/main.tf @@ -1,3 +1,6 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + module "module" { source = "vancluever/module/null" version = "~> 1.0.1" diff --git a/tfjson.go b/tfjson.go index 55f9ac4..3a78a4f 100644 --- a/tfjson.go +++ b/tfjson.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + // Package tfjson is a de-coupled helper library containing types for // the plan format output by "terraform show -json" command. This // command is designed for the export of Terraform plan data in diff --git a/validate.go b/validate.go index 97b82d0..53652ef 100644 --- a/validate.go +++ b/validate.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/validate_test.go b/validate_test.go index c876045..6b7860f 100644 --- a/validate_test.go +++ b/validate_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( diff --git a/version.go b/version.go index 16f0a85..7516ad6 100644 --- a/version.go +++ b/version.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson // VersionOutput represents output from the version -json command diff --git a/version_test.go b/version_test.go index dcd7317..b935fbd 100644 --- a/version_test.go +++ b/version_test.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package tfjson import ( From b6c9bb29a5fcb6d7488fbd5fd9fcc75f7afc4603 Mon Sep 17 00:00:00 2001 From: Liam Cervante Date: Tue, 21 Mar 2023 10:20:29 +0100 Subject: [PATCH 05/14] revert changes to testdata --- .copywrite.hcl | 13 +++++++++++++ testdata/013_module_depends_on/main.tf | 3 --- testdata/110_basic/foo/main.tf | 3 --- testdata/110_basic/module.tf | 3 --- testdata/110_basic/outputs.tf | 3 --- testdata/110_basic/providers.tf | 3 --- testdata/110_basic/resources.tf | 3 --- testdata/110_basic/variables.tf | 3 --- testdata/110_sensitive_values/foo/main.tf | 3 --- testdata/110_sensitive_values/module.tf | 3 --- testdata/110_sensitive_values/outputs.tf | 3 --- testdata/110_sensitive_values/providers.tf | 3 --- testdata/110_sensitive_values/resources.tf | 3 --- testdata/110_sensitive_values/variables.tf | 3 --- testdata/120_basic/foo/main.tf | 3 --- testdata/120_basic/module.tf | 3 --- testdata/120_basic/outputs.tf | 3 --- testdata/120_basic/providers.tf | 3 --- testdata/120_basic/resources.tf | 3 --- testdata/120_basic/variables.tf | 3 --- testdata/basic/foo/main.tf | 3 --- testdata/basic/module.tf | 3 --- testdata/basic/outputs.tf | 3 --- testdata/basic/providers.tf | 3 --- testdata/basic/resources.tf | 3 --- testdata/basic/variables.tf | 3 --- testdata/config_resource_depends_on/main.tf | 3 --- testdata/deep_module/foo/bar/main.tf | 3 --- testdata/deep_module/foo/main.tf | 3 --- testdata/deep_module/main.tf | 3 --- testdata/explicit_null/main.tf | 3 --- testdata/explicit_null/terraform.tfvars | 3 --- testdata/has_changes/foo/main.tf | 3 --- testdata/has_changes/module.tf | 3 --- testdata/has_changes/outputs.tf | 3 --- testdata/has_changes/providers.tf | 3 --- testdata/has_changes/resources.tf | 3 --- testdata/has_changes/variables.tf | 3 --- testdata/nested_config_keys/main.tf | 3 --- testdata/no_changes/foo/main.tf | 3 --- testdata/no_changes/module.tf | 3 --- testdata/no_changes/outputs.tf | 3 --- testdata/no_changes/providers.tf | 3 --- testdata/no_changes/resources.tf | 3 --- testdata/no_changes/variables.tf | 3 --- testdata/output_depends_on/main.tf | 3 --- testdata/provider_version/main.tf | 3 --- testdata/registry_module/main.tf | 3 --- 48 files changed, 13 insertions(+), 141 deletions(-) create mode 100644 .copywrite.hcl diff --git a/.copywrite.hcl b/.copywrite.hcl new file mode 100644 index 0000000..ada7d74 --- /dev/null +++ b/.copywrite.hcl @@ -0,0 +1,13 @@ +schema_version = 1 + +project { + license = "MPL-2.0" + copyright_year = 2019 + + # (OPTIONAL) A list of globs that should not have copyright/license headers. + # Supports doublestar glob patterns for more flexibility in defining which + # files or folders should be ignored + header_ignore = [ + "testdata/**", + ] +} diff --git a/testdata/013_module_depends_on/main.tf b/testdata/013_module_depends_on/main.tf index 69bbfad..5142ecf 100644 --- a/testdata/013_module_depends_on/main.tf +++ b/testdata/013_module_depends_on/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "foo" { source = "vancluever/module/null" diff --git a/testdata/110_basic/foo/main.tf b/testdata/110_basic/foo/main.tf index c982366..6c96638 100644 --- a/testdata/110_basic/foo/main.tf +++ b/testdata/110_basic/foo/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - terraform { required_providers { null = { diff --git a/testdata/110_basic/module.tf b/testdata/110_basic/module.tf index 748acf8..26a3ebe 100644 --- a/testdata/110_basic/module.tf +++ b/testdata/110_basic/module.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "foo" { source = "./foo" diff --git a/testdata/110_basic/outputs.tf b/testdata/110_basic/outputs.tf index c2d5312..1e2a453 100644 --- a/testdata/110_basic/outputs.tf +++ b/testdata/110_basic/outputs.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - output "foo" { sensitive = true value = "bar" diff --git a/testdata/110_basic/providers.tf b/testdata/110_basic/providers.tf index ff1a6f2..e2b7d2e 100644 --- a/testdata/110_basic/providers.tf +++ b/testdata/110_basic/providers.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - terraform { required_providers { null = { diff --git a/testdata/110_basic/resources.tf b/testdata/110_basic/resources.tf index 8b56d9b..d0d408a 100644 --- a/testdata/110_basic/resources.tf +++ b/testdata/110_basic/resources.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/110_basic/variables.tf b/testdata/110_basic/variables.tf index 3aaf377..3964e7a 100644 --- a/testdata/110_basic/variables.tf +++ b/testdata/110_basic/variables.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/110_sensitive_values/foo/main.tf b/testdata/110_sensitive_values/foo/main.tf index 9d5bbd8..7e23c1e 100644 --- a/testdata/110_sensitive_values/foo/main.tf +++ b/testdata/110_sensitive_values/foo/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "bar" { type = string } diff --git a/testdata/110_sensitive_values/module.tf b/testdata/110_sensitive_values/module.tf index 748acf8..26a3ebe 100644 --- a/testdata/110_sensitive_values/module.tf +++ b/testdata/110_sensitive_values/module.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "foo" { source = "./foo" diff --git a/testdata/110_sensitive_values/outputs.tf b/testdata/110_sensitive_values/outputs.tf index c2d5312..1e2a453 100644 --- a/testdata/110_sensitive_values/outputs.tf +++ b/testdata/110_sensitive_values/outputs.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - output "foo" { sensitive = true value = "bar" diff --git a/testdata/110_sensitive_values/providers.tf b/testdata/110_sensitive_values/providers.tf index 23ef26c..502945b 100644 --- a/testdata/110_sensitive_values/providers.tf +++ b/testdata/110_sensitive_values/providers.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - terraform { required_providers { null = { diff --git a/testdata/110_sensitive_values/resources.tf b/testdata/110_sensitive_values/resources.tf index 8b56d9b..d0d408a 100644 --- a/testdata/110_sensitive_values/resources.tf +++ b/testdata/110_sensitive_values/resources.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/110_sensitive_values/variables.tf b/testdata/110_sensitive_values/variables.tf index 3aaf377..3964e7a 100644 --- a/testdata/110_sensitive_values/variables.tf +++ b/testdata/110_sensitive_values/variables.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/120_basic/foo/main.tf b/testdata/120_basic/foo/main.tf index c982366..6c96638 100644 --- a/testdata/120_basic/foo/main.tf +++ b/testdata/120_basic/foo/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - terraform { required_providers { null = { diff --git a/testdata/120_basic/module.tf b/testdata/120_basic/module.tf index 748acf8..26a3ebe 100644 --- a/testdata/120_basic/module.tf +++ b/testdata/120_basic/module.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "foo" { source = "./foo" diff --git a/testdata/120_basic/outputs.tf b/testdata/120_basic/outputs.tf index c2d5312..1e2a453 100644 --- a/testdata/120_basic/outputs.tf +++ b/testdata/120_basic/outputs.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - output "foo" { sensitive = true value = "bar" diff --git a/testdata/120_basic/providers.tf b/testdata/120_basic/providers.tf index ff1a6f2..e2b7d2e 100644 --- a/testdata/120_basic/providers.tf +++ b/testdata/120_basic/providers.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - terraform { required_providers { null = { diff --git a/testdata/120_basic/resources.tf b/testdata/120_basic/resources.tf index 8b56d9b..d0d408a 100644 --- a/testdata/120_basic/resources.tf +++ b/testdata/120_basic/resources.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/120_basic/variables.tf b/testdata/120_basic/variables.tf index 3aaf377..3964e7a 100644 --- a/testdata/120_basic/variables.tf +++ b/testdata/120_basic/variables.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/basic/foo/main.tf b/testdata/basic/foo/main.tf index ffa6741..8c48a85 100644 --- a/testdata/basic/foo/main.tf +++ b/testdata/basic/foo/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "bar" { type = "string" } diff --git a/testdata/basic/module.tf b/testdata/basic/module.tf index 0093efe..236fdac 100644 --- a/testdata/basic/module.tf +++ b/testdata/basic/module.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "foo" { source = "./foo" diff --git a/testdata/basic/outputs.tf b/testdata/basic/outputs.tf index c2d5312..1e2a453 100644 --- a/testdata/basic/outputs.tf +++ b/testdata/basic/outputs.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - output "foo" { sensitive = true value = "bar" diff --git a/testdata/basic/providers.tf b/testdata/basic/providers.tf index 121e8e7..4d48120 100644 --- a/testdata/basic/providers.tf +++ b/testdata/basic/providers.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - provider "null" {} provider "aws" { diff --git a/testdata/basic/resources.tf b/testdata/basic/resources.tf index 2584f74..1d4a8e8 100644 --- a/testdata/basic/resources.tf +++ b/testdata/basic/resources.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/basic/variables.tf b/testdata/basic/variables.tf index 3aaf377..3964e7a 100644 --- a/testdata/basic/variables.tf +++ b/testdata/basic/variables.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/config_resource_depends_on/main.tf b/testdata/config_resource_depends_on/main.tf index aeb2abb..4eede79 100644 --- a/testdata/config_resource_depends_on/main.tf +++ b/testdata/config_resource_depends_on/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - resource "null_resource" "foo" {} resource "null_resource" "bar" { diff --git a/testdata/deep_module/foo/bar/main.tf b/testdata/deep_module/foo/bar/main.tf index ca0b1cd..87b7dc3 100644 --- a/testdata/deep_module/foo/bar/main.tf +++ b/testdata/deep_module/foo/bar/main.tf @@ -1,4 +1 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - resource "null_resource" "baz" {} diff --git a/testdata/deep_module/foo/main.tf b/testdata/deep_module/foo/main.tf index 7ed7c97..88d61ea 100644 --- a/testdata/deep_module/foo/main.tf +++ b/testdata/deep_module/foo/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "bar" { source = "./bar" } diff --git a/testdata/deep_module/main.tf b/testdata/deep_module/main.tf index 0227248..9ae1dbe 100644 --- a/testdata/deep_module/main.tf +++ b/testdata/deep_module/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "foo" { source = "./foo" } diff --git a/testdata/explicit_null/main.tf b/testdata/explicit_null/main.tf index 0e91c13..0970874 100644 --- a/testdata/explicit_null/main.tf +++ b/testdata/explicit_null/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "one" { type = "string" } diff --git a/testdata/explicit_null/terraform.tfvars b/testdata/explicit_null/terraform.tfvars index 3d12b95..6180694 100644 --- a/testdata/explicit_null/terraform.tfvars +++ b/testdata/explicit_null/terraform.tfvars @@ -1,4 +1 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - one = "two" diff --git a/testdata/has_changes/foo/main.tf b/testdata/has_changes/foo/main.tf index bb2a83c..f3d0b00 100644 --- a/testdata/has_changes/foo/main.tf +++ b/testdata/has_changes/foo/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "bar" { type = "string" } diff --git a/testdata/has_changes/module.tf b/testdata/has_changes/module.tf index 0093efe..236fdac 100644 --- a/testdata/has_changes/module.tf +++ b/testdata/has_changes/module.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "foo" { source = "./foo" diff --git a/testdata/has_changes/outputs.tf b/testdata/has_changes/outputs.tf index c2d5312..1e2a453 100644 --- a/testdata/has_changes/outputs.tf +++ b/testdata/has_changes/outputs.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - output "foo" { sensitive = true value = "bar" diff --git a/testdata/has_changes/providers.tf b/testdata/has_changes/providers.tf index 121e8e7..4d48120 100644 --- a/testdata/has_changes/providers.tf +++ b/testdata/has_changes/providers.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - provider "null" {} provider "aws" { diff --git a/testdata/has_changes/resources.tf b/testdata/has_changes/resources.tf index 2584f74..1d4a8e8 100644 --- a/testdata/has_changes/resources.tf +++ b/testdata/has_changes/resources.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/has_changes/variables.tf b/testdata/has_changes/variables.tf index 3aaf377..3964e7a 100644 --- a/testdata/has_changes/variables.tf +++ b/testdata/has_changes/variables.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/nested_config_keys/main.tf b/testdata/nested_config_keys/main.tf index d9d3000..4a43a15 100644 --- a/testdata/nested_config_keys/main.tf +++ b/testdata/nested_config_keys/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - provider "aws" { region = "us-east-1" } diff --git a/testdata/no_changes/foo/main.tf b/testdata/no_changes/foo/main.tf index bb2a83c..f3d0b00 100644 --- a/testdata/no_changes/foo/main.tf +++ b/testdata/no_changes/foo/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "bar" { type = "string" } diff --git a/testdata/no_changes/module.tf b/testdata/no_changes/module.tf index 0093efe..236fdac 100644 --- a/testdata/no_changes/module.tf +++ b/testdata/no_changes/module.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "foo" { source = "./foo" diff --git a/testdata/no_changes/outputs.tf b/testdata/no_changes/outputs.tf index c2d5312..1e2a453 100644 --- a/testdata/no_changes/outputs.tf +++ b/testdata/no_changes/outputs.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - output "foo" { sensitive = true value = "bar" diff --git a/testdata/no_changes/providers.tf b/testdata/no_changes/providers.tf index 121e8e7..4d48120 100644 --- a/testdata/no_changes/providers.tf +++ b/testdata/no_changes/providers.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - provider "null" {} provider "aws" { diff --git a/testdata/no_changes/resources.tf b/testdata/no_changes/resources.tf index 2584f74..1d4a8e8 100644 --- a/testdata/no_changes/resources.tf +++ b/testdata/no_changes/resources.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - resource "null_resource" "foo" { triggers = { foo = "bar" diff --git a/testdata/no_changes/variables.tf b/testdata/no_changes/variables.tf index 3aaf377..3964e7a 100644 --- a/testdata/no_changes/variables.tf +++ b/testdata/no_changes/variables.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - variable "foo" { description = "foobar" default = "bar" diff --git a/testdata/output_depends_on/main.tf b/testdata/output_depends_on/main.tf index 88b1b84..c3dc56c 100644 --- a/testdata/output_depends_on/main.tf +++ b/testdata/output_depends_on/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - resource "null_resource" "foo" {} resource "null_resource" "bar" {} diff --git a/testdata/provider_version/main.tf b/testdata/provider_version/main.tf index 1f96cf8..8200c58 100644 --- a/testdata/provider_version/main.tf +++ b/testdata/provider_version/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - provider "null" { version = "~> 2.1" } diff --git a/testdata/registry_module/main.tf b/testdata/registry_module/main.tf index c8c05d8..f512d2c 100644 --- a/testdata/registry_module/main.tf +++ b/testdata/registry_module/main.tf @@ -1,6 +1,3 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - module "module" { source = "vancluever/module/null" version = "~> 1.0.1" From fb7987f2bc9f1fc602ccd80f2b8f04d1bec2e7af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 10:09:01 +0000 Subject: [PATCH 06/14] Bump actions/checkout from 3.4.0 to 3.5.0 (#80) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/24cb9080177205b6e8c946b17badbe402adc938f...8f4b7f84864484a7bf31766abe9204da3cbe65b3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 38129d6..7ccfab9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: - "1.20" steps: - name: Checkout - uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # https://github.com/actions/checkout/releases/tag/v3.4.0 + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # https://github.com/actions/checkout/releases/tag/v3.5.0 - name: Set up Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # https://github.com/actions/setup-go/releases/tag/v4.0.0 with: From 4b583933ed58b10b98e57f810ca8603d8afdc2b2 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 11 Apr 2023 18:20:21 +0100 Subject: [PATCH 07/14] ci: Add PR test for copyright headers (#83) --- .github/workflows/test.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7ccfab9..c6bc2c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,17 @@ env: GOPROXY: https://proxy.golang.org/ jobs: + copywrite: + runs-on: ubuntu-latest + timeout-minutes: 3 + steps: + - name: Checkout Repo + uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # https://github.com/actions/checkout/releases/tag/v3.5.0 + - name: Install copywrite + uses: hashicorp/setup-copywrite@v1.0.0 + - name: Validate Header Compliance + run: copywrite headers --plan + test: runs-on: ${{ matrix.os }} timeout-minutes: 10 From 5ea6dcf6eb1d74e8ecf837c76075fc3a6a32e160 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 11:08:27 +0100 Subject: [PATCH 08/14] Bump actions/checkout from 3.5.0 to 3.5.1 (#84) Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.0 to 3.5.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/8f4b7f84864484a7bf31766abe9204da3cbe65b3...83b7061638ee4956cf7545a6f7efe594e5ad0247) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6bc2c1..c72311e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: timeout-minutes: 3 steps: - name: Checkout Repo - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # https://github.com/actions/checkout/releases/tag/v3.5.0 + uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # https://github.com/actions/checkout/releases/tag/v3.5.1 - name: Install copywrite uses: hashicorp/setup-copywrite@v1.0.0 - name: Validate Header Compliance @@ -41,7 +41,7 @@ jobs: - "1.20" steps: - name: Checkout - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # https://github.com/actions/checkout/releases/tag/v3.5.0 + uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # https://github.com/actions/checkout/releases/tag/v3.5.1 - name: Set up Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # https://github.com/actions/setup-go/releases/tag/v4.0.0 with: From 902938653cf27d6df2ab4c20a68f7d22cf25c6d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 10:10:38 +0000 Subject: [PATCH 09/14] Bump actions/checkout from 3.5.1 to 3.5.2 Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.1 to 3.5.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/83b7061638ee4956cf7545a6f7efe594e5ad0247...8e5e7e5ab8b370d6c329ec480221332ada57f0ab) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c72311e..a1ed4c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: timeout-minutes: 3 steps: - name: Checkout Repo - uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # https://github.com/actions/checkout/releases/tag/v3.5.1 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # https://github.com/actions/checkout/releases/tag/v3.5.2 - name: Install copywrite uses: hashicorp/setup-copywrite@v1.0.0 - name: Validate Header Compliance @@ -41,7 +41,7 @@ jobs: - "1.20" steps: - name: Checkout - uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # https://github.com/actions/checkout/releases/tag/v3.5.1 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # https://github.com/actions/checkout/releases/tag/v3.5.2 - name: Set up Go uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # https://github.com/actions/setup-go/releases/tag/v4.0.0 with: From 8a756dfbd67b77c72e7da65cd559bda3771885d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 10:10:47 +0000 Subject: [PATCH 10/14] Bump hashicorp/setup-copywrite from 1.0.0 to 1.1.2 Bumps [hashicorp/setup-copywrite](https://github.com/hashicorp/setup-copywrite) from 1.0.0 to 1.1.2. - [Release notes](https://github.com/hashicorp/setup-copywrite/releases) - [Commits](https://github.com/hashicorp/setup-copywrite/compare/v1.0.0...v1.1.2) --- updated-dependencies: - dependency-name: hashicorp/setup-copywrite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c72311e..1819bde 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: - name: Checkout Repo uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # https://github.com/actions/checkout/releases/tag/v3.5.1 - name: Install copywrite - uses: hashicorp/setup-copywrite@v1.0.0 + uses: hashicorp/setup-copywrite@v1.1.2 - name: Validate Header Compliance run: copywrite headers --plan From 2a2fd06c9e4721880bd890523eab63d833a27cb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 05:40:37 -0700 Subject: [PATCH 11/14] Bump actions/setup-go from 4.0.0 to 4.0.1 (#88) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/4d34df0c2316fe8122ab82dc22947d607c0c91f9...fac708d6674e30b6ba41289acaab6d4b75aa0753) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8ba8d7..d667144 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: - name: Checkout uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # https://github.com/actions/checkout/releases/tag/v3.5.2 - name: Set up Go - uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # https://github.com/actions/setup-go/releases/tag/v4.0.0 + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # https://github.com/actions/setup-go/releases/tag/v4.0.1 with: go-version: ${{ matrix.go }} - name: Go mod download From c597f9d4e843c1256f60c8b6e19d11879edff87b Mon Sep 17 00:00:00 2001 From: Liam Cervante Date: Wed, 17 May 2023 06:31:13 -0700 Subject: [PATCH 12/14] Add checks and plan timestamp for Terraform v1.5 (#87) * Add checks and plan timestamp for Terraform v1.5 * add copywrite headers * add module into dynamic address --- checks.go | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ plan.go | 8 +++ state.go | 4 ++ 3 files changed, 157 insertions(+) create mode 100644 checks.go diff --git a/checks.go b/checks.go new file mode 100644 index 0000000..1a4c8cc --- /dev/null +++ b/checks.go @@ -0,0 +1,145 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package tfjson + +// CheckKind is a string representation of the type of conditional check +// referenced in a check result. +type CheckKind string + +const ( + // CheckKindResource indicates the check result is from a pre- or + // post-condition on a resource or data source. + CheckKindResource CheckKind = "resource" + + // CheckKindOutputValue indicates the check result is from an output + // post-condition. + CheckKindOutputValue CheckKind = "output_value" + + // CheckKindCheckBlock indicates the check result is from a check block. + CheckKindCheckBlock CheckKind = "check" +) + +// CheckStatus is a string representation of the status of a given conditional +// check. +type CheckStatus string + +const ( + // CheckStatusPass indicates the check passed. + CheckStatusPass CheckStatus = "pass" + + // CheckStatusFail indicates the check failed. + CheckStatusFail CheckStatus = "fail" + + // CheckStatusError indicates the check errored. This is distinct from + // CheckStatusFail in that it represents a logical or configuration error + // within the check block that prevented the check from executing, as + // opposed to the check was attempted and evaluated to false. + CheckStatusError CheckStatus = "error" + + // CheckStatusUnknown indicates the result of the check was not known. This + // could be because a value within the check could not be known at plan + // time, or because the overall plan failed for an unrelated reason before + // this check could be executed. + CheckStatusUnknown CheckStatus = "unknown" +) + +// CheckStaticAddress details the address of the object that performed a given +// check. The static address points to the overall resource, as opposed to the +// dynamic address which contains the instance key for any resource that has +// multiple instances. +type CheckStaticAddress struct { + // ToDisplay is a formatted and ready to display representation of the + // address. + ToDisplay string `json:"to_display"` + + // Kind represents the CheckKind of this check. + Kind CheckKind `json:"kind"` + + // Module is the module part of the address. This will be empty for any + // resources in the root module. + Module string `json:"module,omitempty"` + + // Mode is the ResourceMode of the resource that contains this check. This + // field is only set is Kind equals CheckKindResource. + Mode ResourceMode `json:"mode,omitempty"` + + // Type is the resource type for the resource that contains this check. This + // field is only set if Kind equals CheckKindResource. + Type string `json:"type,omitempty"` + + // Name is the name of the resource, check block, or output that contains + // this check. + Name string `json:"name,omitempty"` +} + +// CheckDynamicAddress contains the InstanceKey field for any resources that +// have multiple instances. A complete address can be built by combining the +// CheckStaticAddress with the CheckDynamicAddress. +type CheckDynamicAddress struct { + // ToDisplay is a formatted and ready to display representation of the + // full address, including the additional information from the relevant + // CheckStaticAddress. + ToDisplay string `json:"to_display"` + + // Module is the module part of the address. This address will include the + // instance key for any module expansions resulting from foreach or count + // arguments. This field will be empty for any resources within the root + // module. + Module string `json:"module,omitempty"` + + // InstanceKey is the instance key for any instances of a given resource. + // + // InstanceKey will be empty if there was no foreach or count argument + // defined on the containing object. + InstanceKey string `json:"instance_key,omitempty"` +} + +// CheckResultStatic is the container for a "checkable object". +// +// A "checkable object" is a resource or data source, an output, or a check +// block. +type CheckResultStatic struct { + // Address is the absolute address of the "checkable object" + Address CheckStaticAddress `json:"address"` + + // Status is the overall status for all the checks within this object. + Status CheckStatus `json:"status"` + + // Instances contains the results for dynamic object that belongs to this + // static object. For example, any instances created from an object using + // the foreach or count meta arguments. + // + // Check blocks and outputs will only contain a single instance, while + // resources can contain 1 to many. + Instances []CheckResultDynamic `json:"instances,omitempty"` +} + +// CheckResultDynamic describes the check result for a dynamic object that +// results from the expansion of the containing object. +type CheckResultDynamic struct { + // Address is the relative address of this instance given the Address in the + // parent object. + Address CheckDynamicAddress `json:"address"` + + // Status is the overall status for the checks within this dynamic object. + Status CheckStatus `json:"status"` + + // Problems describes any additional optional details about this check if + // the check failed. + // + // This will not include the errors resulting from this check block, as they + // will be exposed as diagnostics in the original terraform execution. It + // may contain any failure messages even if the overall status is + // CheckStatusError, however, as the instance could contain multiple checks + // that returned a mix of error and failure statuses. + Problems []CheckResultProblem `json:"problems,omitempty"` +} + +// CheckResultProblem describes one of potentially several problems that led to +// a check being classied as CheckStatusFail. +type CheckResultProblem struct { + // Message is the condition error message provided by the original check + // author. + Message string `json:"message"` +} diff --git a/plan.go b/plan.go index cbbf186..bbdf8a4 100644 --- a/plan.go +++ b/plan.go @@ -66,6 +66,14 @@ type Plan struct { // RelevantAttributes represents any resource instances and their // attributes which may have contributed to the planned changes RelevantAttributes []ResourceAttribute `json:"relevant_attributes,omitempty"` + + // Checks contains the results of any conditional checks executed, or + // planned to be executed, during this plan. + Checks []CheckResultStatic `json:"checks,omitempty"` + + // Timestamp contains the static timestamp that Terraform considers to be + // the time this plan executed, in UTC. + Timestamp string `json:"timestamp,omitempty"` } // ResourceAttribute describes a full path to a resource attribute diff --git a/state.go b/state.go index 02f0dc6..0f2a999 100644 --- a/state.go +++ b/state.go @@ -35,6 +35,10 @@ type State struct { // The values that make up the state. Values *StateValues `json:"values,omitempty"` + + // Checks contains the results of any conditional checks when Values was + // last updated. + Checks *CheckResultStatic `json:"checks,omitempty"` } // UseJSONNumber controls whether the State will be decoded using the From 327989a875ab436289d7e01233c3655ec5ed167e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 11:01:22 +0100 Subject: [PATCH 13/14] Bump github.com/zclconf/go-cty from 1.13.1 to 1.13.2 (#89) Bumps [github.com/zclconf/go-cty](https://github.com/zclconf/go-cty) from 1.13.1 to 1.13.2. - [Release notes](https://github.com/zclconf/go-cty/releases) - [Changelog](https://github.com/zclconf/go-cty/blob/main/CHANGELOG.md) - [Commits](https://github.com/zclconf/go-cty/compare/v1.13.1...v1.13.2) --- updated-dependencies: - dependency-name: github.com/zclconf/go-cty dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 59fefac..1afbb21 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/mitchellh/copystructure v1.2.0 github.com/sebdah/goldie v1.0.0 - github.com/zclconf/go-cty v1.13.1 + github.com/zclconf/go-cty v1.13.2 github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b ) diff --git a/go.sum b/go.sum index 0f73786..dd44634 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.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc= -github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= +github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= +github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= 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= From 7f5938be3274c12ffbd119c896f44fc274215890 Mon Sep 17 00:00:00 2001 From: Katy Moe Date: Wed, 7 Jun 2023 17:01:24 +0100 Subject: [PATCH 14/14] plan: add plannable import fields for v1.5 --- plan.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plan.go b/plan.go index bbdf8a4..de529ac 100644 --- a/plan.go +++ b/plan.go @@ -208,6 +208,28 @@ type Change struct { // display of sensitive values in user interfaces. BeforeSensitive interface{} `json:"before_sensitive,omitempty"` AfterSensitive interface{} `json:"after_sensitive,omitempty"` + + // Importing contains the import metadata about this operation. If importing + // is present (ie. not null) then the change is an import operation in + // addition to anything mentioned in the actions field. The actual contents + // of the Importing struct is subject to change, so downstream consumers + // should treat any values in here as strictly optional. + Importing *Importing `json:"importing,omitempty"` + + // GeneratedConfig contains any HCL config generated for this resource + // during planning as a string. + // + // If this is populated, then Importing should also be populated but this + // might change in the future. However, not all Importing changes will + // contain generated config. + GeneratedConfig string `json:"generated_config,omitempty"` +} + +// Importing is a nested object for the resource import metadata. +type Importing struct { + // The original ID of this resource used to target it as part of planned + // import operation. + ID string `json:"id,omitempty"` } // PlanVariable is a top-level variable in the Terraform plan.