I'll try to give some background, we're deploying a Grafana instance via Terraform and GitLab CI/CD Pipelines.
The first time the pipeline runs the instance loads perfectly and we can access the grafana UI in a web browser. HOWEVER, if we then re-run the pipeline with changes, we will get a HTTP 500 error when trying to hit the grafana UI in a web browser again, every 'even' number run (2, 4, 6, 8, etc.) will cause this issue but the 'odd' number runs work fine.
I've found the fix to be to add ignore_changes block to the ASG, ignore changes to the load_balancers and target_group_arns - as is recommended by Terraform (https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group)
However I'm struggling to understand what the implications of this change actually are, why does this fix the issue? I've had a Google to try and find some explanation but I can't say I understand any that I've read.
Could anyone help explain what adding these lifecycle rules to the ASG actually do?