:doc:`RDS <../../rds>` / Client / delete_db_security_group

************************
delete_db_security_group
************************



.. py:method:: RDS.Client.delete_db_security_group(**kwargs)

  

  Deletes a DB security group.

   

  The specified DB security group must not be associated with any DB instances.

   

  .. note::

    

    EC2-Classic was retired on August 15, 2022. If you haven't migrated from EC2-Classic to a VPC, we recommend that you migrate as soon as possible. For more information, see `Migrate from EC2-Classic to a VPC <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-migrate.html>`__ in the *Amazon EC2 User Guide*, the blog `EC2-Classic Networking is Retiring – Here’s How to Prepare <http://aws.amazon.com/blogs/aws/ec2-classic-is-retiring-heres-how-to-prepare/>`__, and `Moving a DB instance not in a VPC into a VPC <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.Non-VPC2VPC.html>`__ in the *Amazon RDS User Guide*.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBSecurityGroup>`_  


  **Request Syntax**
  ::

    response = client.delete_db_security_group(
        DBSecurityGroupName='string'
    )
    
  :type DBSecurityGroupName: string
  :param DBSecurityGroupName: **[REQUIRED]** 

    The name of the DB security group to delete.

     

    .. note::

      

      You can't delete the default DB security group.

      

     

    Constraints:

     

    
    * Must be 1 to 255 letters, numbers, or hyphens.
     
    * First character must be a letter
     
    * Can't end with a hyphen or contain two consecutive hyphens
     
    * Must not be "Default"
    

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`RDS.Client.exceptions.InvalidDBSecurityGroupStateFault`

  
  *   :py:class:`RDS.Client.exceptions.DBSecurityGroupNotFoundFault`

  

  **Examples**

  The following example deletes a DB security group.
  ::

    response = client.delete_db_security_group(
        DBSecurityGroupName='mysecgroup',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  