From d41ad2e1dafbfac54dacf3ac9d49b50032122089 Mon Sep 17 00:00:00 2001 From: Ryan Parman Date: Tue, 21 Nov 2023 12:31:36 -0800 Subject: [PATCH] docs: Updated the Terraform documentation to include the lockfile. --- .gitignore | 1 + .licenses.cache.json | 162 ++++++++++----------- docs/data-sources/str_iterative_replace.md | 1 + docs/index.md | 65 +++++++++ examples/provider/lock-all.sh | 20 +++ examples/provider/lock-ext.sh | 12 ++ examples/provider/lock.sh | 8 + templates/index.md.tmpl | 22 +++ 8 files changed, 210 insertions(+), 81 deletions(-) create mode 100644 examples/provider/lock-all.sh create mode 100644 examples/provider/lock-ext.sh create mode 100644 examples/provider/lock.sh diff --git a/.gitignore b/.gitignore index ba4c1942..ccd9a995 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +_/ _*.out _*.txt _cache_/* diff --git a/.licenses.cache.json b/.licenses.cache.json index 80fa7d4e..c5982052 100644 --- a/.licenses.cache.json +++ b/.licenses.cache.json @@ -46,15 +46,15 @@ ], "Indirect": true, "DependsOn": [ + "golang.org/x/crypto@v0.3.0", "github.com/google/uuid@v1.1.1", - "github.com/huandu/xstrings@v1.3.3", - "github.com/mitchellh/copystructure@v1.0.0", "github.com/shopspring/decimal@v1.2.0", - "github.com/Masterminds/semver/v3@v3.2.0", + "github.com/huandu/xstrings@v1.3.3", "github.com/imdario/mergo@v0.3.11", + "github.com/mitchellh/copystructure@v1.0.0", "github.com/spf13/cast@v1.3.1", - "golang.org/x/crypto@v0.3.0", - "github.com/Masterminds/goutils@v1.1.1" + "github.com/Masterminds/goutils@v1.1.1", + "github.com/Masterminds/semver/v3@v3.2.0" ], "Layer": {} }, @@ -158,8 +158,8 @@ ], "Indirect": true, "DependsOn": [ - "github.com/inconshreveable/mousetrap@v1.1.0", - "github.com/spf13/pflag@v1.0.5" + "github.com/spf13/pflag@v1.0.5", + "github.com/inconshreveable/mousetrap@v1.1.0" ], "Layer": {} }, @@ -216,15 +216,15 @@ ], "Indirect": true, "DependsOn": [ - "github.com/google/uuid@v1.3.1", + "github.com/imdario/mergo@v0.3.15", "github.com/shopspring/decimal@v1.3.1", "github.com/spf13/cast@v1.5.0", - "github.com/stretchr/testify@v1.8.4", "github.com/Masterminds/goutils@v1.1.1", "github.com/Masterminds/semver/v3@v3.1.1", + "github.com/google/uuid@v1.3.1", "github.com/huandu/xstrings@v1.3.2", - "github.com/imdario/mergo@v0.3.15", "github.com/mitchellh/copystructure@v1.2.0", + "github.com/stretchr/testify@v1.8.4", "golang.org/x/crypto@v0.15.0" ], "Layer": {} @@ -342,8 +342,8 @@ ], "Indirect": true, "DependsOn": [ - "github.com/google/go-cmp@v0.6.0", - "google.golang.org/protobuf@v1.31.0" + "google.golang.org/protobuf@v1.31.0", + "github.com/google/go-cmp@v0.6.0" ], "Layer": {} }, @@ -374,9 +374,9 @@ "MIT" ], "DependsOn": [ - "github.com/xo/terminfo@v0.0.0-20220910002029-abceb7e1c41e", "golang.org/x/sys@v0.14.0", - "github.com/stretchr/testify@v1.8.4" + "github.com/stretchr/testify@v1.8.4", + "github.com/xo/terminfo@v0.0.0-20220910002029-abceb7e1c41e" ], "Layer": {} }, @@ -388,9 +388,9 @@ "MIT" ], "DependsOn": [ - "github.com/fatih/color@v1.16.0", + "github.com/hexops/gotextdiff@v1.0.3", "github.com/stretchr/testify@v1.8.4", - "github.com/hexops/gotextdiff@v1.0.3" + "github.com/fatih/color@v1.16.0" ], "Layer": {} }, @@ -437,9 +437,9 @@ ], "Indirect": true, "DependsOn": [ - "golang.org/x/text@v0.14.0", "github.com/google/go-cmp@v0.6.0", - "github.com/vmihailenco/msgpack@v4.0.4+incompatible" + "github.com/vmihailenco/msgpack@v4.0.4+incompatible", + "golang.org/x/text@v0.14.0" ], "Layer": {} }, @@ -452,10 +452,10 @@ ], "Indirect": true, "DependsOn": [ + "github.com/stretchr/testify@v1.8.4", "github.com/fatih/color@v1.16.0", "github.com/mattn/go-colorable@v0.1.13", - "github.com/mattn/go-isatty@v0.0.20", - "github.com/stretchr/testify@v1.8.4" + "github.com/mattn/go-isatty@v0.0.20" ], "Layer": {} }, @@ -481,12 +481,12 @@ ], "Indirect": true, "DependsOn": [ - "github.com/hashicorp/go-hclog@v1.5.0", - "github.com/hashicorp/yamux@v0.1.1", - "google.golang.org/grpc@v1.59.0", - "google.golang.org/protobuf@v1.31.0", "github.com/golang/protobuf@v1.5.3", "github.com/oklog/run@v1.1.0", + "google.golang.org/protobuf@v1.31.0", + "github.com/hashicorp/yamux@v0.1.1", + "google.golang.org/grpc@v1.59.0", + "github.com/hashicorp/go-hclog@v1.5.0", "github.com/mitchellh/go-testing-interface@v1.14.1" ], "Layer": {} @@ -520,15 +520,15 @@ ], "Indirect": true, "DependsOn": [ - "github.com/hashicorp/go-cleanhttp@v0.5.2", - "github.com/hashicorp/logutils@v1.0.0", - "golang.org/x/mod@v0.14.0", - "github.com/google/go-cmp@v0.6.0", "github.com/mitchellh/cli@v1.1.5", - "github.com/ProtonMail/go-crypto@v0.0.0-20230923063757-afb1ddc0824c", + "github.com/google/go-cmp@v0.6.0", + "github.com/hashicorp/go-checkpoint@v0.5.0", "github.com/hashicorp/go-multierror@v1.1.1", + "golang.org/x/mod@v0.14.0", + "github.com/ProtonMail/go-crypto@v0.0.0-20230923063757-afb1ddc0824c", + "github.com/hashicorp/go-cleanhttp@v0.5.2", "github.com/hashicorp/go-version@v1.6.0", - "github.com/hashicorp/go-checkpoint@v0.5.0" + "github.com/hashicorp/logutils@v1.0.0" ], "Layer": {} }, @@ -541,13 +541,13 @@ ], "Indirect": true, "DependsOn": [ - "github.com/apparentlymart/go-textseg/v15@v15.0.0", + "github.com/agext/levenshtein@v1.2.3", "github.com/google/go-cmp@v0.6.0", "github.com/spf13/pflag@v1.0.5", "github.com/zclconf/go-cty@v1.14.1", "github.com/davecgh/go-spew@v1.1.1", - "github.com/agext/levenshtein@v1.2.3", "github.com/mitchellh/go-wordwrap@v1.0.1", + "github.com/apparentlymart/go-textseg/v15@v15.0.0", "golang.org/x/crypto@v0.15.0" ], "Layer": {} @@ -571,10 +571,10 @@ ], "Indirect": true, "DependsOn": [ - "github.com/hashicorp/hc-install@v0.6.1", "github.com/hashicorp/go-version@v1.6.0", - "github.com/hashicorp/terraform-json@v0.18.0", "github.com/google/go-cmp@v0.6.0", + "github.com/hashicorp/terraform-json@v0.18.0", + "github.com/hashicorp/hc-install@v0.6.1", "github.com/zclconf/go-cty@v1.14.1" ], "Layer": {} @@ -588,11 +588,11 @@ ], "Indirect": true, "DependsOn": [ - "github.com/mitchellh/copystructure@v1.2.0", "github.com/zclconf/go-cty@v1.14.1", - "github.com/davecgh/go-spew@v1.1.1", "github.com/google/go-cmp@v0.6.0", - "github.com/hashicorp/go-version@v1.6.0" + "github.com/hashicorp/go-version@v1.6.0", + "github.com/mitchellh/copystructure@v1.2.0", + "github.com/davecgh/go-spew@v1.1.1" ], "Layer": {} }, @@ -604,17 +604,17 @@ "MPL-2.0" ], "DependsOn": [ - "github.com/hashicorp/go-version@v1.6.0", - "github.com/hashicorp/terraform-json@v0.18.0", "golang.org/x/text@v0.14.0", - "github.com/mitchellh/cli@v1.1.5", - "github.com/russross/blackfriday@v1.6.0", - "github.com/hashicorp/hc-install@v0.6.1", + "github.com/hashicorp/go-version@v1.6.0", "github.com/hashicorp/terraform-exec@v0.19.0", + "github.com/mattn/go-colorable@v0.1.13", + "github.com/russross/blackfriday@v1.6.0", + "github.com/zclconf/go-cty@v1.14.1", "github.com/google/go-cmp@v0.6.0", + "github.com/hashicorp/terraform-json@v0.18.0", + "github.com/mitchellh/cli@v1.1.5", "golang.org/x/exp@v0.0.0-20230626212559-97b1e661b5df", - "github.com/zclconf/go-cty@v1.14.1", - "github.com/mattn/go-colorable@v0.1.13" + "github.com/hashicorp/hc-install@v0.6.1" ], "Layer": {} }, @@ -627,8 +627,8 @@ ], "DependsOn": [ "github.com/google/go-cmp@v0.6.0", - "github.com/hashicorp/terraform-plugin-log@v0.9.0", - "github.com/hashicorp/terraform-plugin-go@v0.19.1" + "github.com/hashicorp/terraform-plugin-go@v0.19.1", + "github.com/hashicorp/terraform-plugin-log@v0.9.0" ], "Layer": {} }, @@ -640,9 +640,9 @@ "MPL-2.0" ], "DependsOn": [ - "github.com/google/go-cmp@v0.6.0", "github.com/hashicorp/terraform-plugin-framework@v1.4.2", - "github.com/hashicorp/terraform-plugin-go@v0.19.1" + "github.com/hashicorp/terraform-plugin-go@v0.19.1", + "github.com/google/go-cmp@v0.6.0" ], "Layer": {} }, @@ -654,16 +654,16 @@ "MPL-2.0" ], "DependsOn": [ - "github.com/google/go-cmp@v0.6.0", - "google.golang.org/protobuf@v1.31.0", "github.com/hashicorp/go-hclog@v1.5.0", "github.com/hashicorp/terraform-registry-address@v0.2.3", - "github.com/vmihailenco/msgpack/v5@v5.4.1", + "google.golang.org/protobuf@v1.31.0", "github.com/hashicorp/go-plugin@v1.6.0", - "github.com/hashicorp/terraform-plugin-log@v0.9.0", - "github.com/mitchellh/go-testing-interface@v1.14.1", + "github.com/vmihailenco/msgpack/v5@v5.4.1", + "google.golang.org/grpc@v1.59.0", + "github.com/google/go-cmp@v0.6.0", "github.com/hashicorp/go-uuid@v1.0.3", - "google.golang.org/grpc@v1.59.0" + "github.com/hashicorp/terraform-plugin-log@v0.9.0", + "github.com/mitchellh/go-testing-interface@v1.14.1" ], "Layer": {} }, @@ -689,25 +689,25 @@ "MPL-2.0" ], "DependsOn": [ + "github.com/hashicorp/go-hclog@v1.5.0", + "github.com/hashicorp/go-version@v1.6.0", + "github.com/hashicorp/terraform-plugin-log@v0.9.0", "github.com/google/go-cmp@v0.6.0", - "github.com/hashicorp/go-cty@v1.4.1-0.20200414143053-d3edf31b6320", + "github.com/mitchellh/copystructure@v1.2.0", + "github.com/hashicorp/terraform-plugin-go@v0.19.1", "github.com/hashicorp/go-plugin@v1.6.0", - "github.com/mitchellh/reflectwalk@v1.0.2", + "github.com/mitchellh/go-testing-interface@v1.14.1", "github.com/hashicorp/go-uuid@v1.0.3", - "github.com/hashicorp/terraform-json@v0.18.0", "golang.org/x/crypto@v0.15.0", - "github.com/hashicorp/go-hclog@v1.5.0", - "github.com/zclconf/go-cty@v1.14.1", - "github.com/hashicorp/terraform-exec@v0.19.0", - "github.com/hashicorp/go-version@v1.6.0", "github.com/hashicorp/hc-install@v0.6.1", "github.com/hashicorp/hcl/v2@v2.19.1", - "github.com/hashicorp/terraform-plugin-log@v0.9.0", + "github.com/hashicorp/terraform-exec@v0.19.0", + "github.com/hashicorp/terraform-json@v0.18.0", + "github.com/zclconf/go-cty@v1.14.1", "github.com/mitchellh/mapstructure@v1.5.0", + "github.com/hashicorp/go-cty@v1.4.1-0.20200414143053-d3edf31b6320", "github.com/hashicorp/logutils@v1.0.0", - "github.com/hashicorp/terraform-plugin-go@v0.19.1", - "github.com/mitchellh/copystructure@v1.2.0", - "github.com/mitchellh/go-testing-interface@v1.14.1" + "github.com/mitchellh/reflectwalk@v1.0.2" ], "Layer": {} }, @@ -735,10 +735,10 @@ ], "Indirect": true, "DependsOn": [ + "github.com/google/go-cmp@v0.6.0", "github.com/hashicorp/go-cleanhttp@v0.5.2", "github.com/hashicorp/go-version@v1.6.0", "github.com/zclconf/go-cty@v1.14.1", - "github.com/google/go-cmp@v0.6.0", "golang.org/x/net@v0.18.0" ], "Layer": {} @@ -840,12 +840,12 @@ ], "Indirect": true, "DependsOn": [ - "github.com/Masterminds/sprig/v3@v3.2.2", - "github.com/armon/go-radix@v1.0.0", "github.com/bgentry/speakeasy@v0.1.0", "github.com/fatih/color@v1.16.0", "github.com/mattn/go-isatty@v0.0.20", - "github.com/posener/complete@v1.2.3" + "github.com/posener/complete@v1.2.3", + "github.com/Masterminds/sprig/v3@v3.2.2", + "github.com/armon/go-radix@v1.0.0" ], "Layer": {} }, @@ -959,8 +959,8 @@ ], "Indirect": true, "DependsOn": [ - "github.com/stretchr/testify@v1.8.4", - "github.com/hashicorp/go-multierror@v1.1.1" + "github.com/hashicorp/go-multierror@v1.1.1", + "github.com/stretchr/testify@v1.8.4" ], "Layer": {} }, @@ -1104,8 +1104,8 @@ ], "Indirect": true, "DependsOn": [ - "golang.org/x/net@v0.18.0", - "golang.org/x/sys@v0.14.0" + "golang.org/x/sys@v0.14.0", + "golang.org/x/net@v0.18.0" ], "Layer": {} }, @@ -1142,9 +1142,9 @@ ], "Indirect": true, "DependsOn": [ - "golang.org/x/text@v0.14.0", "golang.org/x/crypto@v0.15.0", - "golang.org/x/sys@v0.14.0" + "golang.org/x/sys@v0.14.0", + "golang.org/x/text@v0.14.0" ], "Layer": {} }, @@ -1177,9 +1177,9 @@ ], "Indirect": true, "DependsOn": [ + "google.golang.org/protobuf@v1.31.0", "github.com/golang/protobuf@v1.5.3", - "golang.org/x/text@v0.14.0", - "google.golang.org/protobuf@v1.31.0" + "golang.org/x/text@v0.14.0" ], "Layer": {} }, @@ -1206,12 +1206,12 @@ "Indirect": true, "DependsOn": [ "github.com/golang/protobuf@v1.5.3", + "golang.org/x/sys@v0.14.0", "google.golang.org/genproto/googleapis/rpc@v0.0.0-20231120223509-83a465c0220f", - "golang.org/x/net@v0.18.0", "github.com/google/go-cmp@v0.6.0", - "golang.org/x/sys@v0.14.0", - "google.golang.org/protobuf@v1.31.0", - "github.com/google/uuid@v1.3.1" + "golang.org/x/net@v0.18.0", + "github.com/google/uuid@v1.3.1", + "google.golang.org/protobuf@v1.31.0" ], "Layer": {} }, diff --git a/docs/data-sources/str_iterative_replace.md b/docs/data-sources/str_iterative_replace.md index 772b167e..162330a7 100644 --- a/docs/data-sources/str_iterative_replace.md +++ b/docs/data-sources/str_iterative_replace.md @@ -71,6 +71,7 @@ data "corefunc_str_iterative_replace" "replacements" { ### Nested Schema for `replacements` Required: +* * `new` (String) * `old` (String) diff --git a/docs/index.md b/docs/index.md index 50239a33..84d9920e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -67,4 +67,69 @@ terraform { provider "corefunc" {} ``` +## Updating your Terraform lockfile + +Running `terraform init` will download the provider and update the [_Dependency Lock File_](https://developer.hashicorp.com/terraform/language/files/dependency-lock) (`.terraform.lock.hcl`) for your _current_ OS and CPU architecture. If you have a team with multiple operating systems or multiple CPU architectures, the _Dependency Lock File_ will be incomplete, and other members on the team won't be able to use it. + +In order to resolve this, you can use the `terraform providers lock` command to generate a _Dependency Lock File_ that is compatible with all relevant operating systems and CPU architectures. + +### Recommended matrix + +Per [Recommended Provider Binary Operating Systems and Architectures](https://developer.hashicorp.com/terraform/registry/providers/os-arch): + +```shell +terraform providers lock \ + -platform=darwin_amd64 \ + -platform=darwin_arm64 \ + -platform=linux_amd64 \ + -platform=linux_arm \ + -platform=linux_arm64 \ + -platform=windows_amd64 \ + ; +``` + +### Extended matrix + +```shell +terraform providers lock \ + -platform=darwin_amd64 \ + -platform=darwin_arm64 \ + -platform=freebsd_386 \ + -platform=freebsd_amd64 \ + -platform=linux_386 \ + -platform=linux_amd64 \ + -platform=linux_arm \ + -platform=linux_arm64 \ + -platform=windows_386 \ + -platform=windows_amd64 \ + ; +``` + +### Complete matrix + +This is the complete list of supported operating systems and architectures for this specific provider: + +```shell +terraform providers lock \ + -platform=darwin_amd64 \ + -platform=darwin_arm64 \ + -platform=freebsd_386 \ + -platform=freebsd_amd64 \ + -platform=freebsd_arm \ + -platform=freebsd_arm64 \ + -platform=linux_386 \ + -platform=linux_amd64 \ + -platform=linux_arm \ + -platform=linux_arm64 \ + -platform=netbsd_386 \ + -platform=netbsd_amd64 \ + -platform=openbsd_386 \ + -platform=openbsd_amd64 \ + -platform=windows_386 \ + -platform=windows_amd64 \ + -platform=windows_arm \ + -platform=windows_arm64 \ + ; +``` + diff --git a/examples/provider/lock-all.sh b/examples/provider/lock-all.sh new file mode 100644 index 00000000..2bfe3fd9 --- /dev/null +++ b/examples/provider/lock-all.sh @@ -0,0 +1,20 @@ +terraform providers lock \ + -platform=darwin_amd64 \ + -platform=darwin_arm64 \ + -platform=freebsd_386 \ + -platform=freebsd_amd64 \ + -platform=freebsd_arm \ + -platform=freebsd_arm64 \ + -platform=linux_386 \ + -platform=linux_amd64 \ + -platform=linux_arm \ + -platform=linux_arm64 \ + -platform=netbsd_386 \ + -platform=netbsd_amd64 \ + -platform=openbsd_386 \ + -platform=openbsd_amd64 \ + -platform=windows_386 \ + -platform=windows_amd64 \ + -platform=windows_arm \ + -platform=windows_arm64 \ + ; diff --git a/examples/provider/lock-ext.sh b/examples/provider/lock-ext.sh new file mode 100644 index 00000000..3d44f472 --- /dev/null +++ b/examples/provider/lock-ext.sh @@ -0,0 +1,12 @@ +terraform providers lock \ + -platform=darwin_amd64 \ + -platform=darwin_arm64 \ + -platform=freebsd_386 \ + -platform=freebsd_amd64 \ + -platform=linux_386 \ + -platform=linux_amd64 \ + -platform=linux_arm \ + -platform=linux_arm64 \ + -platform=windows_386 \ + -platform=windows_amd64 \ + ; diff --git a/examples/provider/lock.sh b/examples/provider/lock.sh new file mode 100644 index 00000000..c60aa138 --- /dev/null +++ b/examples/provider/lock.sh @@ -0,0 +1,8 @@ +terraform providers lock \ + -platform=darwin_amd64 \ + -platform=darwin_arm64 \ + -platform=linux_amd64 \ + -platform=linux_arm \ + -platform=linux_arm64 \ + -platform=windows_amd64 \ + ; diff --git a/templates/index.md.tmpl b/templates/index.md.tmpl index 9ccf25f0..1eb0e7ed 100644 --- a/templates/index.md.tmpl +++ b/templates/index.md.tmpl @@ -17,4 +17,26 @@ description: |- {{ tffile "examples/provider/provider.tf" }} +## Updating your Terraform lockfile + +Running `terraform init` will download the provider and update the [_Dependency Lock File_](https://developer.hashicorp.com/terraform/language/files/dependency-lock) (`.terraform.lock.hcl`) for your _current_ OS and CPU architecture. If you have a team with multiple operating systems or multiple CPU architectures, the _Dependency Lock File_ will be incomplete, and other members on the team won't be able to use it. + +In order to resolve this, you can use the `terraform providers lock` command to generate a _Dependency Lock File_ that is compatible with all relevant operating systems and CPU architectures. + +### Recommended matrix + +Per [Recommended Provider Binary Operating Systems and Architectures](https://developer.hashicorp.com/terraform/registry/providers/os-arch): + +{{ codefile "shell" "examples/provider/lock.sh" }} + +### Extended matrix + +{{ codefile "shell" "examples/provider/lock-ext.sh" }} + +### Complete matrix + +This is the complete list of supported operating systems and architectures for this specific provider: + +{{ codefile "shell" "examples/provider/lock-all.sh" }} +