Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

468
Views
How to upload and deploy zip file to AWS elastic beanstalk via CLI?

I do not want to use the console. No manual processes. I need a command line version, something that I can code in my continuous deployment scripts.

As part of the build process, I can output a ZIP file (be it on my local machine or in CI process, e.g: via bitbucket pipelines or AWS codedeploy VM instance).

I want a command like:

aws eb deploy my-app ./server.zip

That is, first upload my chosen zip file and then deploy it (doesn't have to be one command).

The official eb deploy does not seem to support this, nor have I been able to find any other method to do this.

Any ideas would be much appreciated :)

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I don't think eb CLI supports uploading a ZIP and updating an environment but you can use a combination of AWS CLI commands.

  1. Upload the ZIP to S3
  2. Create an application version
  3. Update the environment

Example,

aws s3 cp deploy.zip s3://mybucket/deploy.zip
aws elasticbeanstalk create-application-version --application-name my-app --version-label 12345 --source-bundle S3Bucket="mybucket",S3Key="deploy.zip"
aws elasticbeanstalk update-environment --application-name my-app --environment-name MyApp-env --version-label 12345
over 4 years ago · Santiago Trujillo Report

0

I was looking for this answer as well. I was able to find some AWS documentation that lets you use the Elastic Beanstalk CLI configuration to upload the zip.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html#eb-cli3-artifact

Deploying an artifact instead of the project folder

You can tell the EB CLI to deploy a ZIP file or WAR file that you generate as part of a separate build process by adding the following lines to .elasticbeanstalk/config.yml in your project folder.

deploy:
 artifact: path/to/buildartifact.zip

If you configure the EB CLI in your Git repository, and you don't > commit the artifact to source, use the --staged option to deploy the latest build.

~/eb$ eb deploy --staged

I tested and it did work for me!

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!