authorizeDBSecurityGroupIngress method

Future<AuthorizeDBSecurityGroupIngressResult> authorizeDBSecurityGroupIngress({
  1. required String dBSecurityGroupName,
  2. String? cidrip,
  3. String? eC2SecurityGroupId,
  4. String? eC2SecurityGroupName,
  5. String? eC2SecurityGroupOwnerId,
})

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). For an overview of CIDR ranges, go to the Wikipedia Tutorial.

May throw DBSecurityGroupNotFoundFault. May throw InvalidDBSecurityGroupStateFault. May throw AuthorizationAlreadyExistsFault. May throw AuthorizationQuotaExceededFault.

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 : AWS account number of the owner of the EC2 security group specified in the EC2SecurityGroupName parameter. The AWS 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 {
  ArgumentError.checkNotNull(dBSecurityGroupName, 'dBSecurityGroupName');
  final $request = <String, dynamic>{};
  $request['DBSecurityGroupName'] = dBSecurityGroupName;
  cidrip?.also((arg) => $request['CIDRIP'] = arg);
  eC2SecurityGroupId?.also((arg) => $request['EC2SecurityGroupId'] = arg);
  eC2SecurityGroupName?.also((arg) => $request['EC2SecurityGroupName'] = arg);
  eC2SecurityGroupOwnerId
      ?.also((arg) => $request['EC2SecurityGroupOwnerId'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'AuthorizeDBSecurityGroupIngress',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['AuthorizeDBSecurityGroupIngressMessage'],
    shapes: shapes,
    resultWrapper: 'AuthorizeDBSecurityGroupIngressResult',
  );
  return AuthorizeDBSecurityGroupIngressResult.fromXml($result);
}