copyDBParameterGroup method

Future<CopyDBParameterGroupResult> copyDBParameterGroup({
  1. required String sourceDBParameterGroupIdentifier,
  2. required String targetDBParameterGroupDescription,
  3. required String targetDBParameterGroupIdentifier,
  4. List<Tag>? tags,
})

Copies the specified DB parameter group.

May throw DBParameterGroupNotFoundFault. May throw DBParameterGroupAlreadyExistsFault. May throw DBParameterGroupQuotaExceededFault.

Parameter sourceDBParameterGroupIdentifier : The identifier or ARN for the source DB parameter group. For information about creating an ARN, see Constructing an ARN for Amazon RDS in the Amazon RDS User Guide.

Constraints:

  • Must specify a valid DB parameter group.
  • Must specify a valid DB parameter group identifier, for example my-db-param-group, or a valid ARN.

Parameter targetDBParameterGroupDescription : A description for the copied DB parameter group.

Parameter targetDBParameterGroupIdentifier : 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

Implementation

Future<CopyDBParameterGroupResult> copyDBParameterGroup({
  required String sourceDBParameterGroupIdentifier,
  required String targetDBParameterGroupDescription,
  required String targetDBParameterGroupIdentifier,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(
      sourceDBParameterGroupIdentifier, 'sourceDBParameterGroupIdentifier');
  ArgumentError.checkNotNull(
      targetDBParameterGroupDescription, 'targetDBParameterGroupDescription');
  ArgumentError.checkNotNull(
      targetDBParameterGroupIdentifier, 'targetDBParameterGroupIdentifier');
  final $request = <String, dynamic>{};
  $request['SourceDBParameterGroupIdentifier'] =
      sourceDBParameterGroupIdentifier;
  $request['TargetDBParameterGroupDescription'] =
      targetDBParameterGroupDescription;
  $request['TargetDBParameterGroupIdentifier'] =
      targetDBParameterGroupIdentifier;
  tags?.also((arg) => $request['Tags'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CopyDBParameterGroup',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CopyDBParameterGroupMessage'],
    shapes: shapes,
    resultWrapper: 'CopyDBParameterGroupResult',
  );
  return CopyDBParameterGroupResult.fromXml($result);
}