3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Pulumi で resource の rename を行う方法

Last updated at Posted at 2022-01-27

はじめに

  • Pulumi は terraform state mv に相当する、定義済みの resource の rename を行うことが出来ません
  • pulumi state mv を出来るようにすべきとの議論も行われているため、近々出来るようになる可能性もあります

resource の rename を行う

  1. pulumi state delete <resource URN> を実行し state から resource を管理外に変更
  2. pulumi import [type] [name] [id] を実行し resource を取り込む
  • 必要に応じて、pulumi import 後に pulumi unprotect を実行してください
    • terraform state mv を忠実に再現したい場合
    • terraform import 後に謝って resource を削除しそうになった方は protect のままにしておくことをおすすめします

pulumi state コマンドについて

pulumi state で実行できる処理は deleteunprotect のみです。

unprotectpulumi import で取り込んだ resource を誤って削除しないための機能です
terraform import した resource を誤って削除しそうになった方は有効にしておくことよいでしょう

Reference

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?