As described in the AWS docs there are platform hooks for elastic beanstalk EBS for the deployment process: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/platforms-linux-extend.html
But what can I do, to run a script each time someone changes the EBS configuration, e. g. an environment property?