Deletes a security group. Before deleting a security group, make sure that no instance exists in the security group and that the security group is not referenced by other security groups. Otherwise, the DeleteSecurityGroup request fails.


You can use API Explorer to perform debugging. API Explorer allows you to perform various operations to simplify API usage. For example, you can retrieve APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Name Type Required Example Description
RegionId String Yes cn-hangzhou

The ID of the region where a security group resides. You can call DescribeRegions to view the latest regions of Alibaba Cloud.

SecurityGroupId String Yes sg-securitygroupid1

The ID of the security group.

Action String No DeleteSecurityGroup

The operation that you want to perform. Set the value to DeleteSecurityGroup.

Response parameters

Name Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.


Sample requests
&<Common request parameters>

Successful response examples

XML format


JSON format


Error codes

View error codes