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

***********************
copy_db_parameter_group
***********************



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

  

  Copies the specified DB parameter group.

   

  .. note::

    

    You can't copy a default DB parameter group. Instead, create a new custom DB parameter group, which copies the default parameters and values for the specified DB parameter group family.

    

  

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


  **Request Syntax**
  ::

    response = client.copy_db_parameter_group(
        SourceDBParameterGroupIdentifier='string',
        TargetDBParameterGroupIdentifier='string',
        TargetDBParameterGroupDescription='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type SourceDBParameterGroupIdentifier: string
  :param SourceDBParameterGroupIdentifier: **[REQUIRED]** 

    The identifier or ARN for the source DB parameter group. For information about creating an ARN, see `Constructing an ARN for Amazon RDS <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing>`__ in the *Amazon RDS User Guide*.

     

    Constraints:

     

    
    * Must specify a valid DB parameter group.
    

    

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

    The identifier for the copied DB parameter group.

     

    Constraints:

     

    
    * Can't be null, empty, or blank
     
    * Must contain from 1 to 255 letters, numbers, or hyphens
     
    * First character must be a letter
     
    * Can't end with a hyphen or contain two consecutive hyphens
    

     

    Example: ``my-db-parameter-group``

    

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

    A description for the copied DB parameter group.

    

  
  :type Tags: list
  :param Tags: 

    A list of tags.

     

    For more information, see `Tagging Amazon RDS resources <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html>`__ in the *Amazon RDS User Guide* or `Tagging Amazon Aurora and Amazon RDS resources <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html>`__ in the *Amazon Aurora User Guide*.

    

  
    - *(dict) --* 

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

       

      For more information, see `Tagging Amazon RDS resources <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html>`__ in the *Amazon RDS User Guide* or `Tagging Amazon Aurora and Amazon RDS resources <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html>`__ in the *Amazon Aurora User Guide*.

      

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

        A key is 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 only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$").

        

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

        A value is 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 only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$").

        

      
    

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

    
    ::

      {
          'DBParameterGroup': {
              'DBParameterGroupName': 'string',
              'DBParameterGroupFamily': 'string',
              'Description': 'string',
              'DBParameterGroupArn': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **DBParameterGroup** *(dict) --* 

        Contains the details of an Amazon RDS DB parameter group.

         

        This data type is used as a response element in the ``DescribeDBParameterGroups`` action.

        
        

        - **DBParameterGroupName** *(string) --* 

          The name of the DB parameter group.

          
        

        - **DBParameterGroupFamily** *(string) --* 

          The name of the DB parameter group family that this DB parameter group is compatible with.

          
        

        - **Description** *(string) --* 

          Provides the customer-specified description for this DB parameter group.

          
        

        - **DBParameterGroupArn** *(string) --* 

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

          
    
  
  **Exceptions**
  
  *   :py:class:`RDS.Client.exceptions.DBParameterGroupNotFoundFault`

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

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

  

  **Examples**

  This example copies a DB parameter group.
  ::

    response = client.copy_db_parameter_group(
        SourceDBParameterGroupIdentifier='mymysqlparametergroup',
        TargetDBParameterGroupDescription='My MySQL parameter group copy',
        TargetDBParameterGroupIdentifier='mymysqlparametergroup-copy',
    )
    
    print(response)

  
  Expected Output:
  ::

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

  