Scalr\Service\Aws\Rds\V20130110\RdsApi::createDBSecurityGroup PHP Method

createDBSecurityGroup() public method

Creates a new DB Security Group. DB Security Groups control access to a DB Instance
public createDBSecurityGroup ( string $name, string $description ) : Scalr\Service\Aws\Rds\DataType\DBSecurityGroupData
$name string The name for the DB Security Group. This value is stored as a lowercase string
$description string The description for the DB Security Group
return Scalr\Service\Aws\Rds\DataType\DBSecurityGroupData Returns DBSecurityGroupData on success or throws an exception.
    public function createDBSecurityGroup($name, $description)
    {
        $result = null;
        $options = array('DBSecurityGroupDescription' => (string) $description, 'DBSecurityGroupName' => (string) $name);
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if (!$this->exist($sxml->CreateDBSecurityGroupResult)) {
                throw new RdsException(sprintf(self::UNEXPECTED, 'create DBSecurityGroup'));
            }
            $result = $this->_loadDBSecurityGroupData($sxml->CreateDBSecurityGroupResult->DBSecurityGroup);
        }
        return $result;
    }