Working with security groups in Amazon EC2 - AWS SDK for .NET

Working with security groups in Amazon EC2

In Amazon EC2, a security group acts as a virtual firewall that controls the network traffic for one or more EC2 instances. By default, EC2 associates your instances with a security group that allows no inbound traffic. You can create a security group that allows your EC2 instances to accept certain traffic. For example, if you need to connect to an EC2 Windows instance, you must configure the security group to allow RDP traffic.

Read more about security groups in the Amazon EC2 User Guide for Linux Instances and the Amazon EC2 User Guide for Windows Instances.

When using the AWS SDK for .NET, you can create a security group for use in EC2 in a VPC or EC2-Classic. For more information about EC2 in a VPC versus EC2-Classic, see the Amazon EC2 User Guide for Linux Instances or the Amazon EC2 User Guide for Windows Instances.

Warning

We are retiring EC2-Classic on August 15, 2022. We recommend that you migrate from EC2-Classic to a VPC. For more information, see Migrate from EC2-Classic to a VPC in the Amazon EC2 User Guide for Linux Instances or the Amazon EC2 User Guide for Windows Instances. Also see the blog post EC2-Classic Networking is Retiring – Here's How to Prepare.

For information about the APIs and prerequisites, see the parent section (Working with Amazon EC2).