Releases: cloudposse/terraform-provider-utils
v2.0.2
v2.0.1
Fix goreleaser config for v1 compatibility @aknysh (#524)
what
- Remove
version: 2header from.goreleaser.yml— GoReleaser v1 does not support it - Revert
.FullCommitback to.Commitin ldflags —.FullCommitis a GoReleaser v2 template variable
why
- The shared release workflow (
cloudposse/.github) uses GoReleaser v1 (v1.26.2) - PR #523 added
version: 2and.FullCommitper a CodeRabbit AI suggestion, but the suggestion didn't account for the CI pinning GoReleaser v1 - This caused the release CI to fail with:
only configurations files on version: 1 are supported, yours is version: 2
references
- Failed CI run: https://github.com/cloudposse/terraform-provider-utils/actions/runs/22242392677/job/64349188250
- Original change introduced in #523
Serialize Atmos library calls to prevent concurrent ReadDataSource crash @aknysh (#523)
what
- Add a
sync.Mutexto serialize all calls into the Atmos library from data sourceReadContextfunctions - Wrap Atmos library calls in all 5 data source files with
atmosMu.Lock()/atmosMu.Unlock()
why
The Atmos library was designed as a single-threaded CLI tool. It has package-level mutable state that is explicitly documented as not safe for concurrent use:
// pkg/config/load.go:51-54
// NOTE: This package-level state assumes sequential (non-concurrent) calls to LoadConfig.
// LoadConfig is NOT safe for concurrent use.
var mergedConfigFiles []stringAdditional thread-unsafe global state includes atmosConfig, render, and verboseFlag in errors/error_funcs.go.
Terraform invokes ReadDataSource concurrently (one goroutine per data source instance). Each call enters ProcessComponentInStack → InitCliConfig → LoadConfig, which resets and writes to the shared mergedConfigFiles slice. Concurrent goroutines can corrupt the slice through interleaved reads/writes, causing downstream errors.
When errors occur, the Atmos library calls CheckErrorPrintAndExit() → os.Exit(1) instead of returning errors. This is designed for CLI usage, but inside a Terraform provider (gRPC plugin), os.Exit(1) kills the plugin process without returning a diagnostic error to Terraform, resulting in "Plugin did not respond" errors.
The mutex serializes all Atmos library calls, preventing concurrent access to thread-unsafe global state.
Changes
| File | Change |
|---|---|
internal/provider/atmos_lock.go |
New — var atmosMu sync.Mutex |
internal/provider/data_source_component_config.go |
Wrap ProcessComponentInStack / ProcessComponentFromContext with mutex |
internal/provider/data_source_describe_stacks.go |
Wrap InitCliConfig + ExecuteDescribeStacks with mutex |
internal/provider/data_source_stack_config_yaml.go |
Wrap InitCliConfig + ProcessYAMLConfigFiles with mutex |
internal/provider/data_source_spacelift_stack_config.go |
Wrap CreateSpaceliftStacks with mutex |
internal/provider/data_source_aws_eks_update_kubeconfig.go |
Wrap ExecuteAwsEksUpdateKubeconfig with mutex |
docs/fixes/2026-02-20-concurrent-readdatasource-crash.md |
Root cause analysis and fix documentation |
references
- Atmos
LoadConfigthread-safety comment:pkg/config/load.go:51-54 CheckErrorPrintAndExitimplementation:errors/error_funcs.go:324-366
v2.0.0
Update Atmos to v1.207.0 — fix plugin crash on newer atmos.yaml configs @aknysh (#522)
## what- Update embedded Atmos dependency from v1.189.0 to v1.207.0
- Fix critical
data "utils_component_config"plugin crash ("Plugin did not respond") that occurs when the provider's embedded Atmos version encounters neweratmos.yamlfeatures (stores,hooks,templates.settings.gomplate) - Update import path from deleted
pkg/componentto restoredpkg/describeforProcessComponentInStackandProcessComponentFromContext - Adapt all data source call sites to Atmos v1.207.0 API changes:
- Add
*AtmosConfigurationparameter toMergeWithOptionscalls (deep_merge_json,deep_merge_yaml) - Add
ansibleComponentsBasePathparameter toCreateSpaceliftStacksandProcessYAMLConfigFilescalls - Fix
SliceOfInterfacesToSliceOfStringsto handle single return value
- Add
- Add 19 new tests covering API compatibility and edge cases
why
- Critical bug: The
cloudposse/utilsprovider v1.31.0 embeds Atmos v1.189.0. When users run Atmos CLI v1.200+ and theiratmos.yaml/ stack files contain features that didn't exist in v1.189.0 (e.g.storesblock,hookswithstore-outputs,templates.settings.gomplate,!terraform.stateYAML tags), the provider panics duringcfg.InitCliConfig(), killing the gRPC plugin process. This blocks all components usingcloudposse/stack-config/yaml//modules/remote-state(56+ components in a typical infrastructure repo) - Deleted API: In Atmos v1.201.0,
pkg/component/component_processor.gowas deleted entirely (PR #1774). The two public functions the provider depends on (ProcessComponentInStack,ProcessComponentFromContext) were moved tointernal/exec(not importable). In Atmos v1.207.0, these functions were restored as public API inpkg/describe/component_processor.go - Forward compatibility: Updating to v1.207.0 ensures the provider can parse
atmos.yamlfiles that use all current Atmos features without panicking
references
- See
docs/fixes/2026-02-19-atmos-version-mismatch-plugin-crash.mdfor full root cause analysis, call chain, and scope of impact - Atmos PR #1774 — "Path-based component resolution for all commands" (deleted
pkg/component) - Atmos v1.207.0 — restored
ProcessComponentInStackandProcessComponentFromContextinpkg/describe
Use atmos instead of makefile @goruha (#501)
## what * Use atmos instead of makefilewhy
- build-harness deprecated. Use atmos instead
Fix release workflow @goruha (#499)
## what * Fix release workflowwhy
- Release workflow put's comments into PRs that it is released. Permissions required
references
🤖 Automatic Updates
Added go linting @[dependabot[bot]](https://github.com/apps/dependabot) (#493)
## what * Added go lintingwhy
- Port go linting from atmos
References
v1.31.0
🐛 Bug Fixes
fix: address graph plugin crash and bump atmos to v1.189.0 @RoseSecurity (#498)
## what[!NOTE]
This update does not include addingexamples/tests/packer
- Prevents
panic: assignment to entry in nil map in the utils_component_config data source by adding anilcheck before callingsetEnv(). The crash occurred when theenvparameter was not provided in the Terraform configuration, causing intermittent "Plugin did not respond" errors. The fix ensures consistent behavior whether the env parameter is present or not. - This pull request updates the dependencies in the
go.modfile to use newer versions and adds several new indirect dependencies. - The main focus is on keeping the project up-to-date with the latest releases, improving compatibility, security, and stability.
- Updated the Go version to
1.24.6to leverage the latest language features and security fixes. - Upgraded core dependencies such as
github.com/cloudposse/atmos,github.com/stretchr/testify, andcel.dev/exprfor improved functionality and bug fixes. - Updated AWS SDK packages (
github.com/aws/aws-sdk-go,github.com/aws/aws-sdk-go-v2and related modules) to the latest versions, including new modules likeservice/secretsmanager. Azure SDK packages have also been added. - Upgraded Google Cloud and HashiCorp Vault dependencies for better cloud integration and security.
- Updated many general libraries such as
github.com/fsnotify/fsnotify,github.com/go-git/go-git/v5,github.com/open-policy-agent/opa, andgithub.com/prometheus/client_golangto their latest releases. - Added new indirect dependencies for extended functionality, including
github.com/hack-pad/hackpadfs,github.com/hairyhenderson/gomplate/v4, andgithub.com/valyala/fastjson. - Upgraded Kubernetes client libraries (
k8s.io/client-go,k8s.io/utils) and OpenTelemetry packages to the latest versions for improved observability and cluster management. - Added and updated various utility, encoding, and protocol libraries to enhance compatibility and performance across the codebase, such as
github.com/gogo/protobuf,github.com/itchyny/gojq, andgithub.com/lestrrat-go/jwx/v3.
why
- Attempt to resolve the following provider panic:
Error: Plugin did not respond
with module.tgw_hub_role.module.account_map.data.utils_component_config.config[0],
on .terraform/modules/tgw_hub_role.account_map/modules/remote-state/main.tf line 1, in data "utils_component_config" "config":
1: data "utils_component_config" "config" {
The plugin encountered an error, and failed to respond to the
plugin.(*GRPCProvider).ReadDataSource call. The plugin logs may contain more
details.
Stack trace from the terraform-provider-utils plugin:
panic: assignment to entry in nil map
goroutine 150 [running]:
github.com/cloudposse/atmos/internal/exec.ProcessStacks({{0xc000078090, 0x2f}, {{{0xc001dea2a0, 0x14}, 0x0, {0xc000c330b0, 0x2f}, 0x1, 0x1, 0x1, ...}, ...}, ...}, ...)
github.com/cloudposse/atmos@v1.122.0/internal/exec/utils.go:438 +0x109d
github.com/cloudposse/atmos/pkg/component.ProcessComponentInStack({0xc0028dfb20?, 0x1e?}, {0xc001dea228?, 0x4?}, {0x0?, 0x4?}, {0x0?, 0x4?})
github.com/cloudposse/atmos@v1.122.0/pkg/component/component_processor.go:33 +0x1e7
github.com/cloudposse/atmos/pkg/component.ProcessComponentFromContext({0xc0028dfb20, 0x1e}, {0xc001757bfc, 0x4}, {0xc001757c20, 0x4}, {0xc001757bdc, 0x4}, {0xc001757c10, 0x7}, ...)
github.com/cloudposse/atmos@v1.122.0/pkg/component/component_processor.go:80 +0x3b4
github.com/cloudposse/terraform-provider-utils/internal/provider.dataSourceComponentConfigRead({0x3b9a028?, 0xc0027a0e10?}, 0xc00184ec00, {0x0?, 0x0?})
github.com/cloudposse/terraform-provider-utils/internal/provider/data_source_component_config.go:121 +0x3fb
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0xc0009e2[540](https://github.com/QuicksortRx/qsrx-infra/actions/runs/12280259382/job/34267957429?pr=475#step:3:562), {0x3b9a028, 0xc0027a0e10}, 0xc00184ec00, {0x0, 0x0})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.35.0/helper/schema/resource.go:823 +0x119
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0xc0009e2540, {0x3b9a028, 0xc0027a0e10}, 0xc00184eb00, {0x0, 0x0})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.35.0/helper/schema/resource.go:1043 +0x13a
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0xc000a63710, {0x3b9a028?, 0xc0027a0d50?}, 0xc0027a0cf0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.35.0/helper/schema/grpc_provider.go:1436 +0x6aa
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadDataSource(0xc000997860, {0x3b9a028?, 0xc0027a0270?}, 0xc000b86280)
github.com/hashicorp/terraform-plugin-go@v0.25.0/tfprotov5/tf5server/server.go:688 +0x26d
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler({0x3449080, 0xc000997860}, {0x3b9a028, 0xc0027a0270}, 0xc00184e980, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.25.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:665 +0x1a6
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000926800, {0x3b9a028, 0xc0027a01e0}, {0x3ba7740, 0xc000685d40}, 0xc002843d40, 0xc000a6b1d0, 0x598b680, 0x0)
google.golang.org/grpc@v1.67.1/server.go:1394 +0xe2b
google.golang.org/grpc.(*Server).handleStream(0xc000926800, {0x3ba7740, 0xc000685d40}, 0xc002843d40)
google.golang.org/grpc@v1.67.1/server.go:1805 +0xe8b
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/grpc@v1.67.1/server.go:1029 +0x7f
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 16
google.golang.org/grpc@v1.67.1/server.go:1040 +0x125
Error: The terraform-provider-utils plugin crashed!
This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.
exit status 1- Fixes #453
- Bump Atmos version to most recent release
- Dependency updates