How AWS EB works for each deployment? - amazon-web-services

I have a project in EB linked with codePipline from Github, and I have some files inside my project in .ebextensions & .platform folders
My question is: Does AWS Elastic Beanstalk deploy these files each time I deploy a new version to EB or just one time?
How EB worked behind the sense!?

the .ebextensions and .platform folders need to be part of your application code. So if you're using the CodePipeline Elastic Beanstalk deployment task, the input artefact needs to have these folders. This also allows to include these files in your versioning system.
How EB deploys new servers, depends on how you have configured it to deploy the application. You can find more information in the EB development guide.

Related

elastic beanstalk cli publishing .net core 5 webapi to existing Linux Environment - Multi-proj in one solution

I'm trying to deploy .net core 5 application to Elastic Beanstalk.
I can deploy application via AWS Toolkit. But I'm trying to deploy via EB CLI. Because github actions works with EB CLI.
So when I'm trying command eb deploy, solution create artifact with solution root directory. How can I point to eb deploy command pick up KKWebApi project, not solution.
Many Thanks.

Upadate Elastic Beanstalk environment and ebextensions files

I have an elastic beanstalk environment that the first upload I used with ebextensions to configure all the configurations.
Now, If I want to update the environment again (only change the code) the ebextensions stay the same,
I need to insert the ebextensions into the zip file that I upload to update the beanstalk environment?
Or I can ignore the ebextensions and upload the zip as is?
I create the zip file using Visual Studio and I put the ebextensions inside the code.
Thanks
It depends on what is in your .ebextensions. For example, if you just install some rpm packages, then they will still be installed. But generally you would always include the config files anyway, as EB can deploy your application to new instances and then entire configuration has to be re-done from scratch.

How to upload application code to AWS Beanstalk

I have a pre-built jar that I can deploy on an ec2-instance and it runs reading from a queue and processing some business logic. I want to use it with AWS Beanstalk but when I try to do that Beanstalk asks for application source code in a zip format. Does this mean that I have to provide the code of just my application? but there are a lot of jars that my application jar depends on and does this mean I must package the source code of those jars also with my application jar? Anyway I can just upload my application compiled jar
There are two options for deployment to beanstalk.
you create a zip file of your application and upload it via the console
you use the eb-cli (from the command line) to create the zip file and do the deployment
Here is the documentation for java applications: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Java.html
And the documentation for the eb-cli:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3.html
After setting up the cli environment (getting ssh keys etc) you can deploy with eb deploy
About uploading code to AWS Beanstalk it can be done through beanstalk console.
Having lot of jar file for application, you need to combine all the files in single source bundle and then need to upload.
Below link gives example of
Bundling Multiple WAR Files for Tomcat Environments

AWS beanstalk deployments wipe out environment variables

I have an app that I am deploying through the AWS EB CLI. When I initially setup the environment, I used .ebextensions files and ran eb deploy from the terminal on my machine. This sets everything up correctly including environment variables and node version (8.9) in the beanstalk environment.
Now, if I deploy the app without the .ebextensions directory in the CI, the beanstalk environment gets spun up with default values which sets node back to v6.3 and wipes out the environment variables.
1) Is there a way to keep the current configuration of the beanstalk environment without having to deploy the .ebextensions files every time?
2) If I must deploy the .ebextensions files every time, what is the best approach for sensitive data like passwords?
Side note
I have another app in a different beanstalk environment that I deploy docker containers to. In that instance, the beanstalk environment doesn't get nuked every time I deploy a new container update. I do not send the .ebxtensions files with this deployment either.

How to update particular server files (or) partial deployment in amazon elastic Beanstack?

I deployed a new version in amazon elastic beanstalk with .ebextension folder. But I have only see new deployment version files in website and lost the old files which was present in old version. How to update particular server files (or) partial deployment in amazon elastic beanstalk ?
You cannot partially update deployments in Elastic Beanstalk. The application zip bundle you upload during a deployment entirely replaces the old bundle.
If you want to "partially update" files in a deployment, merge the changes on the machine from which you are deploying, then zip the merged bundle, then deploy the new application version.