Beanstalk resource change detection going haywire

I’m using both aws_elastic_beanstalk_application and aws_elastic_beanstalk_environment in my setup.

However even if I haven’t changed anything to the resource whenever I do a terraform plan or apply it will try to modify the application and environment.

e.g. my application resource will be modified every time:

resource “aws_elastic_beanstalk_application” “xxx-workplace-beanstalk” {
name = “xxx-workplace”

appversion_lifecycle {
service_role = aws_iam_role.xxx-role-beanstalk-service-role.arn
delete_source_from_s3 = true
}
}

$terraform apply

aws_elastic_beanstalk_application.laq-documents-beanstalk will be updated in-place

~ resource “aws_elastic_beanstalk_application” “laq-documents-beanstalk” {
arn = “arn:aws:elasticbeanstalk:eu-west-1:090873533901:application/laq-documents”
id = “laq-documents”
name = “laq-documents”
tags = {}

  + appversion_lifecycle {
      + delete_source_from_s3 = true
      + service_role          = "arn:aws:iam::090873533901:role/laq-role-beanstalk-service-role"
    }
}

The same goes for beanstalk environment. Which will restart my beanstalk environment every apply.

How can I prevent terraform from unnecessary changes?

1 Like

Hi! Were you able to get a resolution for this? I’m having the same issue … every terraform apply wants to redeploy my RDS and Beanstalk environment.