gke-autoneg-controller icon indicating copy to clipboard operation
gke-autoneg-controller copied to clipboard

Add "lifecycle" key in terraform module

Open ariault-blanchard opened this issue 1 year ago • 3 comments

Hello,

Can you add "lifecycle" key in the module to let people use "ignore_changes" with terraform ?

If we want to use it with GKE Autopilot, everytime we are running a plan / apply, it want to change custom metadata added by Autopilot... We could avoid that with "lifecycle" :)

  lifecycle {
    ignore_changes = []
  }

Thank you for creating this module, it resolves a lot of headaches !

ariault-blanchard avatar Feb 09 '24 00:02 ariault-blanchard

While it may work, I'm not so sure that that's entirely correct... It's a bit of a gap in Terraform modules in general that you cannot inject lifecycle attributes (as they can't refer to variables etc). If it does what I think it does (ignoring all updates), it would make making changes in the future quite a bit harder. Could you consider forking the Terraform part of it?

rosmo avatar Feb 09 '24 12:02 rosmo

Hello !

You can just create the entry and leave it empty so it can be overwrite, that was my first idea.

I'll try to work on it.

ariault-blanchard avatar Feb 12 '24 09:02 ariault-blanchard

I don't think that is unfortunately possible. You might want to look into Helm deployment option that is available now, which should get you rid of the annotation spam.

rosmo avatar Apr 17 '24 13:04 rosmo