Task: Get list of EC2 instances Id(s) by beanstalk environment name Solution: envname=”wp-env” for ec2Id in $(aws elasticbeanstalk describe-environment-resources –environment-name…
Task: Copy some file from container to local computer Solution: docker cp <container>:<path><filename.ext> <localpath> Example: docker cp nginx:/var/log/mylog.log . Done.
Task: Implement loop to wait till AWS BeansTalk environment will be ready Implementation: #!/bin/bash echo ‘Waiting…’ status=” iterations=0 maxiterations=20 while…