How to rename terraform resources using the worst and the best options

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024
  • In this episode, I tackle the different ways of renaming resources that are already created and managed by terraform. This episode shows the tree different options that I have used to go about renaming resources as a result of using a more meaningful resource name or converting flat single resources to index based.
    Check out learn.pablossp... for curated list of video materials.
    =================================
    If you wish to support me, I have a kofi page: ko-fi/pablosspot

ความคิดเห็น • 11

  • @JohnVold
    @JohnVold 10 หลายเดือนก่อน

    Really great info!

  • @MdAshraf007
    @MdAshraf007 8 หลายเดือนก่อน +1

    thank you

    • @pablosspot
      @pablosspot  8 หลายเดือนก่อน

      You're welcome

  • @omirrrr
    @omirrrr 5 หลายเดือนก่อน +1

    Option 2 seems better than having to write a moved block

    • @pablosspot
      @pablosspot  5 หลายเดือนก่อน

      100%!

    • @omirrrr
      @omirrrr 5 หลายเดือนก่อน

      @@pablosspot i was manually editing the state in a text editor before i watched this 😂

    • @pablosspot
      @pablosspot  5 หลายเดือนก่อน

      @@omirrrr oooh! I did that before and made a mistake and it was a nightmare to recover. I ended up bailing out of my state file and re-importing all my resources.

  • @flesz_
    @flesz_ 10 หลายเดือนก่อน

    thanks, as always very interesting.
    At my place we still use TF ver 0.11.5 so I have no choice but to do manual state changes and imports :/

    • @pablosspot
      @pablosspot  10 หลายเดือนก่อน

      That’s very very old. Any reason why you are not upgrading. I mean there’s things to be done before getting to version one but there’s also so much things that will make tf easier with any of the version 1 releases.

    • @flesz_
      @flesz_ 10 หลายเดือนก่อน

      @@pablosspot it's just too large. I think they made a team which is responsible for creating mirror infrastructure for different traffic flows with the latest versions of everything. The traffic would be then redirected into that.
      Upgrading everything wouldn't work as there are too many dependencies and the code is old

    • @poochesoutdoor
      @poochesoutdoor 10 หลายเดือนก่อน

      @@flesz_ that’s what I thought. I went through that painful process from 0.12 to 1.1. Extra difficult if you have inherited the code. But if there’s a way you can gradually upgrade, I highly recommend. There’s a number of security related features like masking secret values in state that you can benefit from at least version 1. My words are prescriptive and not imperative :)