///<summary>/// Create a new DB parameter group. Use the action DescribeDBParameterGroupsAsync/// to determine when the DB parameter group is ready to use.///</summary>///<param name="name">Name of the DB parameter group.</param>///<param name="family">Family of the DB parameter group.</param>///<param name="description">Description of the DB parameter group.</param>///<returns>The new DB parameter group.</returns>publicasync Task<DBParameterGroup> CreateDBParameterGroup(string name, string family, string description){var response = await _amazonRDS.CreateDBParameterGroupAsync(
new CreateDBParameterGroupRequest()
{
DBParameterGroupName = name,
DBParameterGroupFamily = family,
Description = description
});
return response.DBParameterGroup;
}
classInstanceWrapper:"""Encapsulates Amazon RDS DB instance actions."""def__init__(self, rds_client):"""
:param rds_client: A Boto3 Amazon RDS client.
"""
self.rds_client = rds_client
@classmethoddeffrom_client(cls):"""
Instantiates this class from a Boto3 client.
"""
rds_client = boto3.client("rds")
return cls(rds_client)
defcreate_parameter_group(
self, parameter_group_name, parameter_group_family, description
):"""
Creates a DB parameter group that is based on the specified parameter group
family.
:param parameter_group_name: The name of the newly created parameter group.
:param parameter_group_family: The family that is used as the basis of the new
parameter group.
:param description: A description given to the parameter group.
:return: Data about the newly created parameter group.
"""try:
response = self.rds_client.create_db_parameter_group(
DBParameterGroupName=parameter_group_name,
DBParameterGroupFamily=parameter_group_family,
Description=description,
)
except ClientError as err:
logger.error(
"Couldn't create parameter group %s. Here's why: %s: %s",
parameter_group_name,
err.response["Error"]["Code"],
err.response["Error"]["Message"],
)
raiseelse:
return response
///<summary>/// Create a new DB parameter group. Use the action DescribeDBParameterGroupsAsync/// to determine when the DB parameter group is ready to use.///</summary>///<param name="name">Name of the DB parameter group.</param>///<param name="family">Family of the DB parameter group.</param>///<param name="description">Description of the DB parameter group.</param>///<returns>The new DB parameter group.</returns>publicasync Task<DBParameterGroup> CreateDBParameterGroup(string name, string family, string description){var response = await _amazonRDS.CreateDBParameterGroupAsync(
new CreateDBParameterGroupRequest()
{
DBParameterGroupName = name,
DBParameterGroupFamily = family,
Description = description
});
return response.DBParameterGroup;
}