Skip to content

create_db_parameter_group async

create_db_parameter_group(
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    db_parameter_group_name: Optional[String] = None,
    db_parameter_group_family: Optional[String] = None,
    description: Optional[String] = None,
    tags: Optional[TagList] = None,
) -> CreateDBParameterGroupResult

Creates a new DB parameter group.

A DB parameter group is initially created with the default parameters for the database engine used by the DB instance. To provide custom values for any of the parameters, you must modify the group after creating it using ModifyDBParameterGroup. Once you've created a DB parameter group, you need to associate it with your DB instance using ModifyDBInstance. When you associate a new DB parameter group with a running DB instance, you need to reboot the DB instance without failover for the new DB parameter group and associated settings to take effect.

This command doesn't apply to RDS Custom.

Parameters:

  • db_parameter_group_name (Optional[String], default: None ) –

    The name of the DB parameter 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

    This value is stored as a lowercase string.

  • db_parameter_group_family (Optional[String], default: None ) –

    The DB parameter group family name. A DB parameter group can be associated with one and only one DB parameter group family, and can be applied only to a DB instance running a database engine and engine version compatible with that DB parameter group family.

    To list all of the available parameter group families for a DB engine, use the following command:

    aws rds describe-db-engine-versions --query "DBEngineVersions[].DBParameterGroupFamily" --engine <engine>

    For example, to list all of the available parameter group families for the MySQL DB engine, use the following command:

    aws rds describe-db-engine-versions --query "DBEngineVersions[].DBParameterGroupFamily" --engine mysql

    The output contains duplicates.

    The following are the valid DB engine values:

    • aurora-mysql

    • aurora-postgresql

    • db2-ae

    • db2-ce

    • db2-se

    • mysql

    • oracle-ee

    • oracle-ee-cdb

    • oracle-se2

    • oracle-se2-cdb

    • postgres

    • sqlserver-ee

    • sqlserver-se

    • sqlserver-ex

    • sqlserver-web

  • description (Optional[String], default: None ) –

    The description for the DB parameter group.

  • tags (Optional[TagList], default: None ) –

    Tags to assign to the DB parameter group.

Raises:

Examples:

To create a DB parameter group The following example creates a DB parameter group.

>>> await client.create_db_parameter_group(db_parameter_group_name='mydbparametergroup', db_parameter_group_family='MySQL8.0', description='My new parameter group')
Source code in docs_src/capo_rds/_services/async_rds.py
async def create_db_parameter_group(
    self,
    *,
    config_overrides: Optional[AsyncRDSClientConfig] = None,
    db_parameter_group_name: Optional["capo_rds.types.string.String"] = None,
    db_parameter_group_family: Optional["capo_rds.types.string.String"] = None,
    description: Optional["capo_rds.types.string.String"] = None,
    tags: Optional["capo_rds.types.tag_list.TagList"] = None,
) -> "capo_rds.types.create_db_parameter_group_result.CreateDBParameterGroupResult":
    """<p>Creates a new DB parameter group.</p> <p>A DB parameter group is initially created with the default parameters for the database engine used by the DB instance. To provide custom values for any of the parameters, you must modify the group after creating it using <code>ModifyDBParameterGroup</code>. Once you've created a DB parameter group, you need to associate it with your DB instance using <code>ModifyDBInstance</code>. When you associate a new DB parameter group with a running DB instance, you need to reboot the DB instance without failover for the new DB parameter group and associated settings to take effect.</p> <p>This command doesn't apply to RDS Custom.</p>

    Args:
        db_parameter_group_name: <p>The name of the DB parameter group.</p> <p>Constraints:</p> <ul> <li> <p>Must be 1 to 255 letters, numbers, or hyphens.</p> </li> <li> <p>First character must be a letter</p> </li> <li> <p>Can't end with a hyphen or contain two consecutive hyphens</p> </li> </ul> <note> <p>This value is stored as a lowercase string.</p> </note>
        db_parameter_group_family: <p>The DB parameter group family name. A DB parameter group can be associated with one and only one DB parameter group family, and can be applied only to a DB instance running a database engine and engine version compatible with that DB parameter group family.</p> <p>To list all of the available parameter group families for a DB engine, use the following command:</p> <p> <code>aws rds describe-db-engine-versions --query "DBEngineVersions[].DBParameterGroupFamily" --engine &lt;engine&gt;</code> </p> <p>For example, to list all of the available parameter group families for the MySQL DB engine, use the following command:</p> <p> <code>aws rds describe-db-engine-versions --query "DBEngineVersions[].DBParameterGroupFamily" --engine mysql</code> </p> <note> <p>The output contains duplicates.</p> </note> <p>The following are the valid DB engine values:</p> <ul> <li> <p> <code>aurora-mysql</code> </p> </li> <li> <p> <code>aurora-postgresql</code> </p> </li> <li> <p> <code>db2-ae</code> </p> </li> <li> <p> <code>db2-ce</code> </p> </li> <li> <p> <code>db2-se</code> </p> </li> <li> <p> <code>mysql</code> </p> </li> <li> <p> <code>oracle-ee</code> </p> </li> <li> <p> <code>oracle-ee-cdb</code> </p> </li> <li> <p> <code>oracle-se2</code> </p> </li> <li> <p> <code>oracle-se2-cdb</code> </p> </li> <li> <p> <code>postgres</code> </p> </li> <li> <p> <code>sqlserver-ee</code> </p> </li> <li> <p> <code>sqlserver-se</code> </p> </li> <li> <p> <code>sqlserver-ex</code> </p> </li> <li> <p> <code>sqlserver-web</code> </p> </li> </ul>
        description: <p>The description for the DB parameter group.</p>
        tags: <p>Tags to assign to the DB parameter group.</p>

    Raises:
        capo_rds.errors.db_parameter_group_already_exists_fault.DBParameterGroupAlreadyExistsFault: <p>A DB parameter group with the same name exists.</p>
        capo_rds.errors.db_parameter_group_quota_exceeded_fault.DBParameterGroupQuotaExceededFault: <p>The request would result in the user exceeding the allowed number of DB parameter groups.</p>
        capo_rds.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To create a DB parameter group
        The following example creates a DB parameter group.

        >>> await client.create_db_parameter_group(db_parameter_group_name='mydbparametergroup', db_parameter_group_family='MySQL8.0', description='My new parameter group')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_rds.types.create_db_parameter_group_message.CreateDBParameterGroupMessage]",
    ) -> AsyncOperationResponse[
        "capo_rds.types.create_db_parameter_group_result.CreateDBParameterGroupResult"
    ]:
        import capo_rds._operations.amazon_rd_sv19.create_db_parameter_group

        (
            output,
            http_response,
        ) = await capo_rds._operations.amazon_rd_sv19.create_db_parameter_group.async_create_db_parameter_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDBParameterGroup")
    )
    input_: capo_rds.types.create_db_parameter_group_message.CreateDBParameterGroupMessage = {}
    if db_parameter_group_name is not None:
        input_["db_parameter_group_name"] = db_parameter_group_name
    if db_parameter_group_family is not None:
        input_["db_parameter_group_family"] = db_parameter_group_family
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output