首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >执行terraform show报错Failed to marshal state to json: unsupported attribute "xxx"

执行terraform show报错Failed to marshal state to json: unsupported attribute "xxx"

原创
作者头像
用户10680481
发布2025-02-28 09:23:58
发布2025-02-28 09:23:58
1730
举报

当 terraform 执行 terraform show -json 报错Failed to marshal state to json: unsupported attribute "xxx"时一般为provider版本不正确

1、查看了文档:

https://developer.hashicorp.com/terraform/plugin/testing/migrating#failed-to-marshal-state-to-json官网提供的不是想要解决的问题

https://developer.genesys.cloud/forum/t/error-in-running-plan-error-marshaling-prior-state-unsupported-attribute-managed/27875这个提示使用terraform refresh确实解决了问题,但是我有成千上万个workspace不可能每个都执行一边

2、参考Issues:

https://github.com/hashicorp/terraform-provider-aws/issues/31637查看aws遇到的问题时一个not used字段,也没有一个好的启发

3、查看日志,关注截图中rs_type字段,查看执行terrafrom show的版本,并查看版本中是否存在rs_type字段,最终

发现,provider版本做了一次升级,使用分支版本,而terrafrom show没有指定版本,默认拉取了最新版本,所以导致此问题

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档