• Terrafrom: Ignore changes on some of the managed resources

    2 min read

    Some of the resources we create using terraform might be externally changed, for example an AutoScalingGroup desired_capacity can be changed externally (not modifying terraform's state) in order to handle more traffic. That's the case for the worker's ASG on an EKS cluster, which will be usually modified by the cluster autoscaler

    (...)
    
    Note: Objects have changed outside of Terraform
    
    Terraform detected the following changes made outside of Terraform since the last "terraform apply":
    
      # module.eks.aws_autoscaling_group.workers["pet2cattle_eu-west-1a"] has been changed
      ~ resource "aws_autoscaling_group" "workers" {
          ~ desired_capacity          = 7 -> 6
            id                        = "pet2cattle_eu-west-1a2021082509502468370000000a"
            name                      = "pet2cattle_eu-west-1a2021082509502468370000000a"
            # (22 unchanged attributes hidden)
    
    
            # (16 unchanged blocks hidden)
        }
    
    Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or respond to these changes.
    
    (...)
    

    13/10/2021

    Read more...

From pet to cattle
Treat your kubernetes clusters like cattle, not pets