:doc:`DocDB <../../docdb>` / Client / create_db_subnet_group

**********************
create_db_subnet_group
**********************



.. py:method:: DocDB.Client.create_db_subnet_group(**kwargs)

  

  Creates a new subnet group. subnet groups must contain at least one subnet in at least two Availability Zones in the Amazon Web Services Region.

  

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


  **Request Syntax**
  ::

    response = client.create_db_subnet_group(
        DBSubnetGroupName='string',
        DBSubnetGroupDescription='string',
        SubnetIds=[
            'string',
        ],
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type DBSubnetGroupName: string
  :param DBSubnetGroupName: **[REQUIRED]** 

    The name for the subnet group. This value is stored as a lowercase string.

     

    Constraints: Must contain no more than 255 letters, numbers, periods, underscores, spaces, or hyphens. Must not be default.

     

    Example: ``mySubnetgroup``

    

  
  :type DBSubnetGroupDescription: string
  :param DBSubnetGroupDescription: **[REQUIRED]** 

    The description for the subnet group.

    

  
  :type SubnetIds: list
  :param SubnetIds: **[REQUIRED]** 

    The Amazon EC2 subnet IDs for the subnet group.

    

  
    - *(string) --* 

    

  :type Tags: list
  :param Tags: 

    The tags to be assigned to the subnet group.

    

  
    - *(dict) --* 

      Metadata assigned to an Amazon DocumentDB resource consisting of a key-value pair.

      

    
      - **Key** *(string) --* 

        The required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can't be prefixed with " ``aws:``" or " ``rds:``". The string can contain only the set of Unicode letters, digits, white space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$").

        

      
      - **Value** *(string) --* 

        The optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can't be prefixed with " ``aws:``" or " ``rds:``". The string can contain only the set of Unicode letters, digits, white space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$").

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'DBSubnetGroup': {
              'DBSubnetGroupName': 'string',
              'DBSubnetGroupDescription': 'string',
              'VpcId': 'string',
              'SubnetGroupStatus': 'string',
              'Subnets': [
                  {
                      'SubnetIdentifier': 'string',
                      'SubnetAvailabilityZone': {
                          'Name': 'string'
                      },
                      'SubnetStatus': 'string'
                  },
              ],
              'DBSubnetGroupArn': 'string',
              'SupportedNetworkTypes': [
                  'string',
              ]
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **DBSubnetGroup** *(dict) --* 

        Detailed information about a subnet group.

        
        

        - **DBSubnetGroupName** *(string) --* 

          The name of the subnet group.

          
        

        - **DBSubnetGroupDescription** *(string) --* 

          Provides the description of the subnet group.

          
        

        - **VpcId** *(string) --* 

          Provides the virtual private cloud (VPC) ID of the subnet group.

          
        

        - **SubnetGroupStatus** *(string) --* 

          Provides the status of the subnet group.

          
        

        - **Subnets** *(list) --* 

          Detailed information about one or more subnets within a subnet group.

          
          

          - *(dict) --* 

            Detailed information about a subnet.

            
            

            - **SubnetIdentifier** *(string) --* 

              Specifies the identifier of the subnet.

              
            

            - **SubnetAvailabilityZone** *(dict) --* 

              Specifies the Availability Zone for the subnet.

              
              

              - **Name** *(string) --* 

                The name of the Availability Zone.

                
          
            

            - **SubnetStatus** *(string) --* 

              Specifies the status of the subnet.

              
        
      
        

        - **DBSubnetGroupArn** *(string) --* 

          The Amazon Resource Name (ARN) for the DB subnet group.

          
        

        - **SupportedNetworkTypes** *(list) --* 

          The network type of the DB subnet group.

           

          Valid Values: ``IPV4`` | ``DUAL``

           

          A ``DBSubnetGroup`` can support only the IPv4 protocol or the IPv4 and the IPv6 protocols (DUAL).

          
          

          - *(string) --* 
      
    
  
  **Exceptions**
  
  *   :py:class:`DocDB.Client.exceptions.DBSubnetGroupAlreadyExistsFault`

  
  *   :py:class:`DocDB.Client.exceptions.DBSubnetGroupQuotaExceededFault`

  
  *   :py:class:`DocDB.Client.exceptions.DBSubnetQuotaExceededFault`

  
  *   :py:class:`DocDB.Client.exceptions.DBSubnetGroupDoesNotCoverEnoughAZs`

  
  *   :py:class:`DocDB.Client.exceptions.InvalidSubnet`

  