Reputation: 2044
I have a running EC2 instance with few security groups added. What I want to do is to remove one of the security group and add a new one.
I think there will be no problem in adding a new security group. But is it possible to remove a security group without terminating existing ec2 instance and creating a new one from the ami ?
Upvotes: 5
Views: 8819
Reputation: 3027
From the AWS documentation this is how you can remove a security group from a insance:
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
In the navigation pane, choose Instances.
Select your instance, and then choose Actions, Security, Change security groups.
For Associated security groups, select a security group from the list and choose Add security group.
To remove an already associated security group, choose Remove for that security group.
Choose Save.
Upvotes: 3
Reputation: 2719
FWIW, you can also change the inbound/outbound rules of the current security group instead of removing it and adding a new one. Changes to inbound/outbound rules also take effect immediately with no need to stop EC2.
Upvotes: 2
Reputation: 1767
yes, it is possible both to add and remove security group. In AWS web console go to EC2 Instances page, right click on instance you want to change -> Networking -> Change Security Group You can easily check that it is done without terminating or even stopping the instance.
Upvotes: 10