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).
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.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The name of the DB Security Group to add authorization to. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Authorize database security group access for a given security group.
// Instantiate the class $rds = new AmazonRDS(); $response = $rds->authorize_db_security_group_ingress('mySecurityGroup', array( 'EC2SecurityGroupName' => 'default', 'EC2SecurityGroupOwnerId' => CFCredentials::get('@default')->account_id )); // Success? var_dump($response->isOK());Result:
bool(true)
Authorize database security group access for a CIDR IP Range.
// Instantiate the class $rds = new AmazonRDS(); $response = $rds->authorize_db_security_group_ingress('mySecurityGroup', array( 'CIDRIP' => '0.0.0.0/0' )); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/rds.class.php | Toggle source view (7 lines) | View on GitHub