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

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.

Related

Deploy webapp to AWS Elastic Beanstalk using Jenkins Pipeline

I've manually deployed my web application to AWS EBS. We use to normally have a jenkins pipeline which deployed the app to tomcat server running on AWS using mvn tomcat8:redeploy-only -Ddeploy.address=xx.xx.xx.xx:port
How do you deploy to AWS EBS with Jenkins, at the moment I'm having to upload the war file each time we have an update.
Any help is much appreciated.
Thanks
I haven't tried, but there is a Jenkins plugin for Elastic Beanstalk.
Alternatively, you could install elb cli in your Jenkins nodes to manage your environments.
I used AWS Beanstalk publisher jenkins plugin which allowed me to set up post-build actions which was the answer. You need to specify S3 bucket in the settings of where your app will be deployed to and set up version labelling. Thanks for kgiannakakis for referring this to me.
A good video I used can be found here: deploy war file to aws ebs

Elastic Beanstalk Always Updates Environment On Deploy From Codebuild

I have a large, multi-component django application I am trying to deploy to elastic beanstalk. I am using the multi-docker environment. THis is my current workflow
Git commit triggers AWS code pipeline
AWS Codebuild builds docker image (docker-compose build), runs some tests, and pushes this image to AWS Elastic Container Registry
AWS Code Build calls eb deploy
The issue I am running into is that when I call eb deploy from my local box, the it simply upgrades the application, but when I call it from Code Build, it is upgrading the environment every time, which takes about 30 minutes for some reason
I run the deploy command with -v and confirmed that the same files are being zipped. Any ideas on what is going on here, is my setup incorrect?
I also tried to deploy the application from Code Deploy in the pipeline and can confirm that it also always upgrades the entire environement.
I think that if you use CB to update your EB env, it just replaces it as it is being considered as a new environment. In your local workstation you are using only one single environment, but with new application version.
I would consider replacing CB for updating your EB environment, with the EB deploy provider in your CP. This should successful just upload your new application version to an existing EB environment.
CP natively supports a number of deploy action providers, one of the being Elastic Beanstalk:
You can configure CodePipeline to use Elastic Beanstalk to deploy your code. You can create the Elastic Beanstalk application and environment to use in a deploy action in a stage either before you create the pipeline or when you use the Create Pipeline wizard.

AWS code deploy to deploy

Right now I am manually deploying WAR files onto wildfly server(which is hosted on an ec2 instance) but I want to automate this and get rid of the manual deployments.
I build the application using jenkins (from another EC2 instance) and after that i want to deploy to the wildfly server and since i am also planning to user codepipeline, can anyone please tell me how to deploy an applcation on wildfly server using AWS CodeDeploy?
I am new to codedeploy so not that familiar with its usage.
Thank you,
Ajit
Hi #Ajith Code Deploy is the perfect tool for deploying applications in AWS. But it has some limitations, for example to give a source repository for the Code Build/ Code Deploy you can only choose these 3 as the code repository.
AWS Code Commit
AWS S3 Bucket
Guthub
You cant provide your own custom repository or Bitbucket. Please go through the below Examples for deploying applications using Code Deploy. I can't explain all the steps because it have a lot of steps. here they are explaining app deployment using tomcat, replace this with your wildfly scripts.
Deploy Applications From S3 using Code Deploy.

Elastic Beanstalk: How can my team deploy code to the same environment?

I was previously on Google App Engine and have migrated to Amazon Elastic Beanstalk. My team and I are working together on a website, but only I have managed to deploy code from my own computer.
How would my team go about deploying the code to the environment from their own computers? They have installed the eb command line tool.
They need to install EB CLI on their computer. Once EB CLI is install they can run "eb deploy" command. More information here.
Run eb init and eb create on one machine so that the environment is up and running.
On all machines you need setup .elasticbeanstalk and ..ebextensions folders, add them to git for example.
Run aws configure on each machine. The profile name in .elasticbeanstalk/config needs to match to the credentials in ~/.aws/config
http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
Don't forget to add permissions to your users. You can start with power user permission, but you should create a more specific role/policy for this later.
When this is setup all your users should be able to eb deploy.

AWS CodeDeploy?

My app is created using elastic-beanstalk aws service, do I need to use the AWS CodeDeploy service to deploy my app?
Currently I just do:
eb deploy myApp
Then, a new application version is deployed without using AWS CodeDeploy.
So, AM I doing something wrong?
Elastic beanstalk do it on your behalf. During deployment process you define some polices and roles, which defines elastic beanstalk will call these services on your behalf. Codedeploy is one of that services.
Elasticbeanstalk does automation of your process only and setup thet whole deployment environment for you (php,nginx/apache in case of web), if you look /opt/elasticbeanstalk/, you can see codedeploy folder there, which means that you do not need to do it manually.
AWS code deploy is different workaround and provides more controlling. How you want your changes to be pushed, is it to be pushed on all instances an once or one by one, minimum number of healthy instances.
Check here-
http://cloudacademy.com/blog/how-to-deploy-application-code-from-s3-using-aws-codedeploy/
http://blog.powerupcloud.com/2016/03/24/deployment-automation-using-aws-code-depoly/
https://blogs.aws.amazon.com/application-management/post/Tx33XKAKURCCW83/Automatically-Deploy-from-GitHub-Using-AWS-CodeDeploy
You can update the your application with new version. CLI as follows
$eb deploy --version
You are not doing anything wrong. EB Deploy will enable you to deploy your apps being served from Elastic Beanstalk. AWS Code Deploy on the other hand is more flexible & gives you more control, you can for example, deploy apps you are serving from EC2 thats not being managed by Elastic Beanstalk.
With AWS you can for example deploy to multiple environments ie development, staging, production.
Elastic Beanstalk and CodeDeploy are totally different AWS services and independent of each other and follow different deployment approaches.
What you're doing is totally correct to deploy a new version of your code.
AWS elastic-bean-stalk itself has the nice capability for deploying applications nicely.You dont need to use aws code deploy again.It will be superflous.You can use beanstalk tools itself to deploy the code.
AWS CodeDeploy is a building block service focused on helping developers deploy and update software on any instance, including Amazon EC2 instances and instances running on-premises.
AWS Elastic Beanstalk (as well as AWS OpsWorks btw) are end-to-end application management solutions.
When it comes to deploying new software release on Beanstalk, you better use the own deployment process provided to you by Beanstalk.
eb deploy myApp