I have tried to change the instance security group by right click and then "change security groups", but it's grayed out.
Update:-
I have a rails application and I want to give the response from the particular Ip(ex: 12.123.12.456) requests, if the request from that IP(ex: 12.123.12.456) then give the response otherwise drop the request.
so I am trying to change the security group in AWS.
what to do?
It seems like your instance is in EC2-Classic. You can not change security group for EC2-classic instance. You should first migrate your instance to EC2-VPC environment and then you can change security group as and when necessary.
P.S: Better give proper description for your question. With the question posted as above, one can only assume and answer unless you provide the accurate information.