Menu
Amazon Relational Database Service
API Reference (API Version 2014-10-31)

AuthorizeDBSecurityGroupIngress

Enables ingress to a DBSecurityGroup using one of two forms of authorization. First, EC2 or VPC security groups can be added to the DBSecurityGroup if the application using the database is running on EC2 or VPC instances. Second, IP ranges are available if the application accessing your database is running on the Internet. Required parameters for this API are one of CIDR range, EC2SecurityGroupId for VPC, or (EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId for non-VPC).

Note

You cannot authorize ingress from an EC2 security group in one AWS Region to an Amazon RDS DB instance in another. You cannot authorize ingress from a VPC security group in one VPC to an Amazon RDS DB instance in another.

For an overview of CIDR ranges, go to the Wikipedia Tutorial.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

CIDRIP

The IP range to authorize.

Type: String

Required: No

DBSecurityGroupName

The name of the DB security group to add authorization to.

Type: String

Required: Yes

EC2SecurityGroupId

Id of the EC2 security group to authorize. For VPC DB security groups, EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId must be provided.

Type: String

Required: No

EC2SecurityGroupName

Name of the EC2 security group to authorize. For VPC DB security groups, EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId must be provided.

Type: String

Required: No

EC2SecurityGroupOwnerId

AWS account number of the owner of the EC2 security group specified in the EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable value. For VPC DB security groups, EC2SecurityGroupId must be provided. Otherwise, EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId must be provided.

Type: String

Required: No

Response Elements

The following element is returned by the service.

DBSecurityGroup

Contains the result of a successful invocation of the following actions:

This data type is used as a response element in the DescribeDBSecurityGroups action.

Type: DBSecurityGroup object

Errors

For information about the errors that are common to all actions, see Common Errors.

AuthorizationAlreadyExists

The specified CIDRIP or EC2 security group is already authorized for the specified DB security group.

HTTP Status Code: 400

AuthorizationQuotaExceeded

DB security group authorization quota has been reached.

HTTP Status Code: 400

DBSecurityGroupNotFound

DBSecurityGroupName does not refer to an existing DB security group.

HTTP Status Code: 404

InvalidDBSecurityGroupState

The state of the DB security group does not allow deletion.

HTTP Status Code: 400

Example

Sample Request

Copy
https://rds.us-east-1.amazonaws.com/ ?Action=AuthorizeDBSecurityGroupIngress &CIDRIP=54.241.217.9%2F32 &DBSecurityGroupName=default &SignatureMethod=HmacSHA256 &SignatureVersion=4 &Version=2014-09-01 &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Credential=AKIADQKE4SARGYLE/20140423/us-east-1/rds/aws4_request &X-Amz-Date=20140423T154632Z &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date &X-Amz-Signature=7803146e430626f47b0da058921cdb9f2ab7ffd881bd99fc859f2f635e4472bd

Sample Response

Copy
<AuthorizeDBSecurityGroupIngressResponse xmlns="http://rds.amazonaws.com/doc/2014-09-01/"> <AuthorizeDBSecurityGroupIngressResult> <DBSecurityGroup> <EC2SecurityGroups> <EC2SecurityGroup> <Status>authorized</Status> <EC2SecurityGroupName>elasticbeanstalk-windows</EC2SecurityGroupName> <EC2SecurityGroupOwnerId>803#########</EC2SecurityGroupOwnerId> <EC2SecurityGroupId>sg-7f476617</EC2SecurityGroupId> </EC2SecurityGroup> </EC2SecurityGroups> <DBSecurityGroupDescription>default</DBSecurityGroupDescription> <IPRanges> <IPRange> <CIDRIP>192.0.0.0/24</CIDRIP> <Status>authorized</Status> </IPRange> <IPRange> <CIDRIP>190.0.1.0/29</CIDRIP> <Status>authorized</Status> </IPRange> <IPRange> <CIDRIP>190.0.2.0/29</CIDRIP> <Status>authorized</Status> </IPRange> <IPRange> <CIDRIP>10.0.0.0/8</CIDRIP> <Status>authorized</Status> </IPRange> </IPRanges> <OwnerId>803#########</OwnerId> <DBSecurityGroupName>default</DBSecurityGroupName> </DBSecurityGroup> </AuthorizeDBSecurityGroupIngressResult> <ResponseMetadata> <RequestId>6176b5f8-bfed-11d3-f92b-31fa5e8dbc99</RequestId> </ResponseMetadata> </AuthorizeDBSecurityGroupIngressResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: