Amazon Relational Database Service
API Reference (API Version 2012-04-23)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

AuthorizeDBSecurityGroupIngress

Description

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]Note
You cannot authorize ingress from an EC2 security group in one 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 common parameters that all actions use, see Common Query Parameters.

Name Description Required
CIDRIP

The IP range to authorize.

Type: String

No
DBSecurityGroupName

The name of the DB Security Group to add authorization to.

Type: String

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

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

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

No

Response Elements

The following elements come wrapped in a DBSecurityGroup structure.
NameDescription
DBSecurityGroupDescription

Provides the description of the DB Security Group.

Type: String

DBSecurityGroupName

Specifies the name of the DB Security Group.

Type: String

EC2SecurityGroups

Contains a list of EC2SecurityGroup elements.

Type: EC2SecurityGroup list

IPRanges

Contains a list of IPRange elements.

Type: IPRange list

OwnerId

Provides the AWS ID of the owner of a specific DB Security Group.

Type: String

VpcId

Provides the VpcId of the DB Security Group.

Type: String

Errors

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

Error Description HTTP Status Code
AuthorizationAlreadyExists

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

400
AuthorizationQuotaExceeded

Database security group authorization quota has been reached.

400
DBSecurityGroupNotFound

DBSecurityGroupName does not refer to an existing DB Security Group.

404
InvalidDBSecurityGroupState

The state of the DB Security Group does not allow deletion.

400

Examples

Sample Request

https://rds.amazonaws.com/
    ?CIDRIP=192.168.1.1%2F24
    &DBSecurityGroupName=mydbsecuritygroup
    &Version=2012-04-23
    &Action=AuthorizeDBSecurityGroupIngress
    &SignatureVersion=2
    &SignatureMethod=HmacSHA256
    &Timestamp=2011-02-15T17%3A10%3A50.274Z
    &AWSAccessKeyId=<AWS Access Key ID>
    &Signature=<Signature>

Sample Response

<AuthorizeDBSecurityGroupIngressResponse xmlns="http://rds.amazonaws.com/doc/2012-04-23/">
  <AuthorizeDBSecurityGroupIngressResult>
    <DBSecurityGroup>
      <EC2SecurityGroups/>
      <DBSecurityGroupDescription>My new DBSecurityGroup</DBSecurityGroupDescription>
      <IPRanges>
        <IPRange>
          <CIDRIP>192.168.1.1/24</CIDRIP>
          <Status>authorizing</Status>
        </IPRange>
      </IPRanges>
      <OwnerId>621567473609</OwnerId>
      <DBSecurityGroupName>mydbsecuritygroup</DBSecurityGroupName>
      <VpcId>vpc-1ab2c3d4</VpcId>
    </DBSecurityGroup>
  </AuthorizeDBSecurityGroupIngressResult>
  <ResponseMetadata>
    <RequestId>d9799197-bf2d-11de-b88d-993294bf1c81</RequestId>
  </ResponseMetadata>
</AuthorizeDBSecurityGroupIngressResponse>