Posts

Showing posts from April, 2018

Customize Elastic Beanstalk Environment

Occasionally, you will need to customize environment for applications running in Elastic Beanstalk. Some of the use cases can be:
Download properties/configuration files, used by application, from S3Run customized scripts which make use of environment variablesCreate or modify files/directories One of the approach, to customize environment, is to use Elastic Beanstalk configuration files. These configuration files are part of source code and are usually placed at root of source code in folder .ebextensions.  Lets consider a use case where web application reads properties from a file. And file needs to be downloaded from S3.
Create folder .ebextensions at root of source code.  Create file 'downloadPropertiesFile.config' in folder .ebextensions with following content in yaml format:
container_commands: 010-downloadfile: command: sudo /usr/bin/aws s3 --region eu-west-1 cp s3://${Bucket_Path_To_File_In_S3} /destination_file_path If using gradle, add following content …