authorizeDBSecurityGroupIngress method
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 can't authorize ingress from an EC2 security group in one Amazon Web Services Region to an Amazon RDS DB instance in another. You can't 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.
May throw AuthorizationAlreadyExistsFault.
May throw AuthorizationQuotaExceededFault.
May throw DBSecurityGroupNotFoundFault.
May throw InvalidDBSecurityGroupStateFault.
Parameter dBSecurityGroupName :
The name of the DB security group to add authorization to.
Parameter cidrip :
The IP range to authorize.
Parameter 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.
Parameter 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.
Parameter eC2SecurityGroupOwnerId :
Amazon Web Services account number of the owner of the EC2 security group
specified in the EC2SecurityGroupName parameter. The Amazon
Web Services access key ID isn't an acceptable value. For VPC DB security
groups, EC2SecurityGroupId must be provided. Otherwise,
EC2SecurityGroupOwnerId and either
EC2SecurityGroupName or EC2SecurityGroupId must
be provided.
Implementation
Future<AuthorizeDBSecurityGroupIngressResult>
authorizeDBSecurityGroupIngress({
required String dBSecurityGroupName,
String? cidrip,
String? eC2SecurityGroupId,
String? eC2SecurityGroupName,
String? eC2SecurityGroupOwnerId,
}) async {
final $request = <String, String>{
'DBSecurityGroupName': dBSecurityGroupName,
if (cidrip != null) 'CIDRIP': cidrip,
if (eC2SecurityGroupId != null) 'EC2SecurityGroupId': eC2SecurityGroupId,
if (eC2SecurityGroupName != null)
'EC2SecurityGroupName': eC2SecurityGroupName,
if (eC2SecurityGroupOwnerId != null)
'EC2SecurityGroupOwnerId': eC2SecurityGroupOwnerId,
};
final $result = await _protocol.send(
$request,
action: 'AuthorizeDBSecurityGroupIngress',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'AuthorizeDBSecurityGroupIngressResult',
);
return AuthorizeDBSecurityGroupIngressResult.fromXml($result);
}