AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the DescribeSecurityGroups operation. Describes the specified security groups or all of your security groups.
Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z
public class DescribeSecurityGroupsRequest : AmazonEC2Request IAmazonWebServiceRequest
The DescribeSecurityGroupsRequest type exposes the following members
Name | Description | |
---|---|---|
DescribeSecurityGroupsRequest() |
Name | Type | Description | |
---|---|---|---|
Filters | System.Collections.Generic.List<Amazon.EC2.Model.Filter> |
Gets and sets the property Filters. The filters. If using multiple filters for rules, the results include security groups for which any combination of rules - not necessarily a single rule - match all filters.
|
|
GroupIds | System.Collections.Generic.List<System.String> |
Gets and sets the property GroupIds. The IDs of the security groups. Required for security groups in a nondefault VPC. Default: Describes all of your security groups. |
|
GroupNames | System.Collections.Generic.List<System.String> |
Gets and sets the property GroupNames. [Default VPC] The names of the security groups. You can specify either the security group name or the security group ID. Default: Describes all of your security groups. |
|
MaxResults | System.Int32 |
Gets and sets the property MaxResults. The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. This value can be between 5 and 1000. If this parameter is not specified, then all items are returned. For more information, see Pagination. |
|
NextToken | System.String |
Gets and sets the property NextToken. The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
This example describes the specified security group.
var client = new AmazonEC2Client(); var response = client.DescribeSecurityGroups(new DescribeSecurityGroupsRequest { GroupIds = new List<string> { "sg-903004f8" } });
This example describes the security groups that include the specified tag (Purpose=test).
var client = new AmazonEC2Client(); var response = client.DescribeSecurityGroups(new DescribeSecurityGroupsRequest { Filters = new List<Filter> { new Filter { Name = "tag:Purpose", Values = new List<string> { "test" } } } });
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5