GoogleCloudPlatform / gke-autoneg-controller

This GKE controller provides simple custom integration between GKE and GCLB.
Apache License 2.0
159 stars 50 forks source link

Add "lifecycle" key in terraform module #114

Open ariault-blanchard opened 7 months ago

ariault-blanchard commented 7 months ago

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 !

rosmo commented 7 months ago

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?

ariault-blanchard commented 7 months ago

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.

rosmo commented 5 months ago

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.