Deploy the war from S3 to AWS Elastic Beanstalk

I have 2 AWS machines, 1.dev (ec2) 2. prod (elastic beanstalk) . I create and deploy to dev (machine1) after each commit, which is output to a military file (which will also be loaded into the S3 bucket using the s3cmd tool). Then I test the recently launched war on a dev machine, if it seems perfect, then I load the war with dev (ec2) and then load it into the machine for production (elastic beanstalk).

Is there a way to make an elastic beanstalk to take the war directly from the S3 bucket, rather than loading it from ec2 and then loading it into the elastic beanstalk?

I tried to create a new environment, and then gave the path to the s3 bucket for the application version, but it does not work. (gave some error saying "this can only be done in VPC").

+6
source share
2 answers

I have a better answer in this post :

AWS CLI requires 3 simple steps:

  • Download to S3 bucket: aws s3 cp /var/lib/tomcat7/webapps/ROOT.war s3: // elasticbeanstalk-ap-southeast-1-xxxxxx / myROOT.war
  • Create application version: aws elasticbeanstalk create-application-version - application name your_app_name --version-label your_version_label --source-bundle S3Bucket = elasticbeanstalk-ap-southeast-1-xxxxxx, S3Key = myROOT.war
  • Update your environment: aws elasticbeanstalk update-environment --environment-name your_app_name --version-label your_version_label

I created a bash script that takes only 3 seconds for all of the above steps. Follow the link for a more detailed answer.

+15
source

If your s3 war file is in the mybucket / test / myapp.war file, then creating a version of the application with the s3 bucket as mybucket and test/myapp.war is the way to do this. Not sure why you are getting a VPC related error. When and where do you see this error? When do you create a version of an application or create an environment? Does the API call immediately generate an error message in the following events?

+2
source

Source: https://habr.com/ru/post/974879/


All Articles