How to Design or Architect
I need to know what strategy we should use when we try to upgrade an agent on a running ec2. In order to follow cloud standards what i did is. i created an AMI and that has got my agent installed, so any new ec2 made by that AMI is having the agent installed. But when i want to upgrade the agent. how should i go about it?
Which is the best option here:
- Code deploy
- Code pipeline
or what else should be a good approach to follow?
You could either follow "golden AMI" approach - in this case you create a CI/CD pipeline (e.g CodeBuild/Jenkins/TeamCity/etc) that when your new agent version is build - it triggers rebuild of AMI - either via HashiCorp Packer or EC2 Image builder and you further update your nodes to that latest AMI - you could do that via ASG & Launch Templates.
Another way - if you want just have basic AMI that you've already created - and just update the agent on some basis - you better leverage SSM (AWS Systems Manager) features like Distributor that allows to package and publish software on the managed nodes (you need SSM Agent pre-installed for that and ec2 Profile that allows SSM). Or you could just simply use 'Run command" in SSM and run any script that do the task of updating for you on any number of managed machines.
Thanks a lot Aleksandr As you suggested, i am using codepipeline to build AMI. it is working fine when i would need the agent for the first time.. then ec2 created from that AMI would have it.. And when new version of agent is released it would simplu trigger the pipeline and it would create a new AMI. After that when i want to upgrade the agent on existing ec2, how would i do that will new AMI. could you please suggest me on it , or can help me with any doc to follow or any video to explain,. I really need to understand how would we do it. so my current work remains of worth.
Thanks a lot again for your valuable time please.
Waiting for your comments.
Clock frequency of CL is fixed or it can be changed for target design?asked 10 months ago
ECS Container not recognizing EC2 instances after updating AMIasked 3 years ago
Create Strategy to alert from email deadlocks in databaseAccepted Answerasked a year ago
Subdomain redirection to EC2 instanceasked 2 years ago
A lambda function to delete old archive files in s3 bucketasked 3 years ago
Get input from agent before placing an outbound callasked 2 months ago
How to Design or Architectasked 6 days ago
Failed when run code deployasked a month ago
How do I deactivate an AWS service?asked 10 days ago
Upgrade ecs-agent on Windows 2016 ECS Optimized AMasked 2 years ago