逕行升級 Terraform 遇到 “data could not be decoded from the state”

我曾經用舊版 Terraform 佈署一個環境(約 0.11 版)
在那之後再也沒動過該環境
直到今天用新版 Terraform 打算去做 refresh、destroy
根據錯誤訊息,Terraform 無法解讀 state 中 aws_cloudfront_distributionactive_trusted_signers

還好在這篇 Github issue 的 comment 裡面有人給出解決方式
是先用 terraform state pull >> state.json 把 state dump 出來
再手動根據這篇文章的說明去改 state.json
並且手動將 state.json 的 “serial” 加一
接著執行 terraform state push state.json 即可


日期

作者

分類

留言

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *