Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (5.6k points)
How can add a security group to an instance using CLI?

1 Answer

0 votes
by (12.4k points)

For default one, you can use the below commands:

aws ec2 modify-instance-attribute --instance-id i-123 --groups sg-1 sg-2 ..

And if the instance has more than one network interface, then use the below commands:

aws ec2 modify-network-interface-attribute --groups sg-1 sg-2 --network-interface-id eni-1

For more, you can read here.

Want to learn more about AWS? Come & join: AWS Certification

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...