
OPERATIONAL DEFECT DATABASE
...


...

### Terraform Version ```shell v1.13.4 ``` ### Terraform Configuration Files Any plan file contains `ephemeral` resource ### Debug Output I have plan file that creates ephemeral resources and when I executed `terraform show -json planfile`, it crashed with the following error message: ```text !!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!! Terraform crashed! This is always indicative of a bug within Terraform. Please report the crash with Terraform[1] so that we can fix this. When reporting bugs, please include your terraform version, the stack trace shown below, and any additional information which may help replicate the issue. [1]: https://github.com/hashicorp/terraform/issues !!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!! panic: unsupported resource mode 69 goroutine 1 [running]: runtime/debug.Stack() runtime/debug/stack.go:26 +0x5e github.com/hashicorp/terraform/internal/logging.PanicHandler() github.com/hashicorp/terraform/internal/logging/panic.go:84 +0x16a panic({0x34fe320?, 0xc001e3b400?}) runtime/panic.go:792 +0x132 github.com/hashicorp/terraform/internal/command/jsonchecks.makeStaticObjectAddr({0x44a0468, 0xc0005d5440}) github.com/hashicorp/terraform/internal/command/jsonchecks/objects.go:33 +0x925 github.com/hashicorp/terraform/internal/command/jsonchecks.MarshalCheckStates(0xc000724218) github.com/hashicorp/terraform/internal/command/jsonchecks/checks.go:51 +0x267 github.com/hashicorp/terraform/internal/command/jsonplan.Marshal(0xc0008856c0, 0xc0007e64e0, 0xc0008f06c0, 0xc000b0dbd0) github.com/hashicorp/terraform/internal/command/jsonplan/plan.go:317 +0x45f github.com/hashicorp/terraform/internal/command/views.(*ShowJSON).Display(0xc000724020, 0x0?, 0x0?, 0xc002045988?, 0x0?, 0x1800000000000000?) github.com/hashicorp/terraform/internal/command/views/show.go:143 +0xfa github.com/hashicorp/terraform/internal/command.(*ShowCommand).Run(0xc000582700, {0xc000070160, 0x2, 0x2}) github.com/hashicorp/terraform/internal/command/show.go:86 +0x543 github.com/hashicorp/cli.(*CLI).Run(0xc0005d2280) github.com/hashicorp/cli@v1.1.7/cli.go:265 +0x4de main.realMain() github.com/hashicorp/terraform/main.go:339 +0x1deb main.main() github.com/hashicorp/terraform/main.go:64 +0x13 ``` I have checked the [source code](https://github.com/hashicorp/terraform/blob/b221cc00957adcd9642b2fd8cf285670405ca53b/internal/command/jsonchecks/objects.go#L26-L34): ```go ret["kind"] = "resource" switch addr.Resource.Mode { case addrs.ManagedResourceMode: ret["mode"] = "managed" case addrs.DataResourceMode: ret["mode"] = "data" default: panic(fmt.Sprintf("unsupported resource mode %#v", addr.Resource.Mode)) } ``` Looks like we need add logic for `ephemeral` block? ### Expected Behavior No panic ### Actual Behavior Panic, crashed ### Steps to Reproduce `terraform plan -out=file` to create a plan with `ephemeral` in your TF config, then `terraform show -json ` ### Additional Context _No response_ ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.