Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.7k users

Browse Categories

...