Score:0

Run Github actions workflow ec2 auto scaled servers

ru flag

Our application is hosted on AWS EC2, we add code updates & fix bugs every few weeks. Our code is on github and github actions does the deployment with automated & manual workflows. We have a good traffic so we have already added 5 servers with load balancer pointing to them. We want to apply auto scaling on our applications server, so that there would be no constant number of servers instead the servers will auto scale and redeploy our app according to the application traffic.
But my question is as we have added the IPs on the github actions workflow when the servers will scale up and deploy new servers the ips will change, so how would github actions will know where to deploy the codes?
Can anyone give me any suggestions or any way to debug this issue? Thanks in advance.

tilleyc avatar
us flag
You should look into AWS CodeDeploy.
MD Nasirul Islam avatar
ru flag
thanks for the info
Tim avatar
gp flag
Tim
I would probably look at source changes triggering AWS Code Pipeline, which builds / tests if required using AWS Code Build, then with manual approval uses AWS Code Deploy for deployment. It will take a bit of work to get going. You will probably be best creating an AMI with each software version, though you can have a base AMI that installs everything with a startup script but that takes longer to start a new server.
MD Nasirul Islam avatar
ru flag
Can I use the base image? just update the codes on the base image? so that it could be deployed on the servers? Whats the best practice? cc: @Tim
Tim avatar
gp flag
Tim
Yes you can use a base image and update. Base image can be plain linux then you update / install software / install application, or your AMI can be fairly up to date and you just run updates of patches and latest application. Trade-offs both ways. Best do some reading.
MD Nasirul Islam avatar
ru flag
thanks for the tips @Tim
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.