Changing security group when an instance is running

Is there a way to change the security group when an instance is running?

Yes. Follow the steps below:

  1. Select the instance for which you want to change the security group.
  2. Click on the Actions tab.
  3. Select “Change Security Groups” option.
  4. Select the required security group.
  5. Click on assign security groups.

You can change the security only if instance is launched within VPC. If instance is launched under EC2 classic then, there is no way to change the security group.
However, Accounts created after 2013-12-04, supports only VPC and all instances will be launched in default VPC, if user has not created any VPC. So concept of EC2-classic has vanished on account created after 2013-12-04.