Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to assign a security group to an existing instance. Is this possible?

share|improve this question

2 Answers

up vote 2 down vote accepted

No, it isn't possible to assign a new security group to an instance that has already been started. However, changes to the rules of a security group do get propagated to running instances that belong to that group.

For example, if you launch an instance in the "default" security group, but you forgot to add the rule to allow ssh, you can add that rule to the "default" group and then you will be able to ssh to the running instance.

share|improve this answer
3  
Thanks for your answer. Do know if there is a reason for this? – Alex Nov 16 '12 at 9:03

Create a new security group called new.

Get the id of your image (<image-id>)

select id from security_groups where name = 'new' ;
update security_group_instance_association set security_group_id=<security-group-id> where instance_id=<image-id> ;
share|improve this answer
Where are we supposed to run this query? – Franck Dernoncourt Apr 6 at 2:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.