You can call the DescribeSecurityGroupConfiguration operation to query the security groups of Elastic Compute Service (ECS) that are added to the whitelist of an instance.
After an ECS security group is added to the whitelist of an instance, the ECS instances in the security group can access the RDS instance. For more information about how to configure a whitelist, see Configure an IP address whitelist for an ApsaraDB RDS instance.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeSecurityGroupConfiguration | The operation that you want to perform. Set the value to DescribeSecurityGroupConfiguration. |
DBInstanceId | String | Yes | rm-uf6wjk5xxxxxx | The ID of the instance. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
DBInstanceName | String | rm-uf6wjk5xxxxxx | The ID of the instance. |
RequestId | String | 87BDAE8C-ACB0-4A26-BBCC-7D1DD31D630D | The ID of the request. |
Items | Array of EcsSecurityGroupRelation | An array that consists of information about the ECS security group. |
|
EcsSecurityGroupRelation | |||
NetworkType | String | VPC | The network type of the ECS security group. Valid values:
|
SecurityGroupId | String | sg-xxxxxxx | The ID of the ECS security group. |
RegionId | String | cn-hangzhou | The region ID of the security group. |
SecurityGroupName | String | security-group-emraccess | The name of the security group. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=DescribeSecurityGroupConfiguration
&DBInstanceId=rm-uf6wjk5xxxxxx
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeSecurityGroupConfigurationResponse>
<DBInstanceName>rm-uf6wjk5xxxxxx</DBInstanceName>
<RequestId>87BDAE8C-ACB0-4A26-BBCC-7D1DD31D630D</RequestId>
<Items>
<NetworkType>VPC</NetworkType>
<SecurityGroupId>sg-xxxxxxx</SecurityGroupId>
<RegionId>cn-hangzhou</RegionId>
<SecurityGroupName>security-group-emraccess</SecurityGroupName>
</Items>
</DescribeSecurityGroupConfigurationResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"DBInstanceName" : "rm-uf6wjk5xxxxxx",
"RequestId" : "87BDAE8C-ACB0-4A26-BBCC-7D1DD31D630D",
"Items" : [ {
"NetworkType" : "VPC",
"SecurityGroupId" : "sg-xxxxxxx",
"RegionId" : "cn-hangzhou",
"SecurityGroupName" : "security-group-emraccess"
} ]
}
Error codes
For a list of error codes, see Service error codes.