Can we upgrade versions in multiple EC2-Instance at the same time?
Put simply, yes. You're responsible for everything at the Operating System level (including upgrades, software, config).
You could use configuration management systems to manage a fleet of servers, or some form of orchestration to perform actions on your fleet at the same time.
Here if I upgrade Instance A with PHP 5.4, do I’ve to repeat the upgrade process in Instance B?
Yes. You need to do one of the following:
- Update all existing EC2s in service
- Terminate all existing EC2s (and have them replaced by new images) ... don't do this all at once, you're site may crumble under the load
More Info
If you're okay with old/new applications side by side for a short while you've got plenty of options. Here's one example:
- Take A out of ELB-Service and upgrade it to 5.4
- Test A before putting it back in service
- Put A back in ELB-Service, make sure traffic is hitting it successfully
- Repeat steps, this time for B
You might have one of the servers out for a number of seconds, or minutes with this sort of strategy (longer for more complex updates). You'll also have a period of time where users may bounce from old to new configurations.
There are other strategies, for instance you may be using images (AMIs) and AutoScaling with Amazon ELB and you may want(need) to update the image, register it with the ELB, and kill EC2s (that will then be replaced with the new instance image).
Typically Database related changes are much more difficult to plan for and that's probably outside of the scope of what you've asked for.