createDBCluster method

Future<CreateDBClusterResult> createDBCluster({
  1. required String dBClusterIdentifier,
  2. required String engine,
  3. List<String>? availabilityZones,
  4. int? backupRetentionPeriod,
  5. String? characterSetName,
  6. String? dBClusterParameterGroupName,
  7. String? dBSubnetGroupName,
  8. String? databaseName,
  9. bool? deletionProtection,
  10. List<String>? enableCloudwatchLogsExports,
  11. bool? enableIAMDatabaseAuthentication,
  12. String? engineVersion,
  13. String? kmsKeyId,
  14. String? masterUserPassword,
  15. String? masterUsername,
  16. String? optionGroupName,
  17. int? port,
  18. String? preSignedUrl,
  19. String? preferredBackupWindow,
  20. String? preferredMaintenanceWindow,
  21. String? replicationSourceIdentifier,
  22. bool? storageEncrypted,
  23. List<Tag>? tags,
  24. List<String>? vpcSecurityGroupIds,
})

Creates a new Amazon Neptune DB cluster.

You can use the ReplicationSourceIdentifier parameter to create the DB cluster as a Read Replica of another DB cluster or Amazon Neptune DB instance.

Note that when you create a new cluster using CreateDBCluster directly, deletion protection is disabled by default (when you create a new production cluster in the console, deletion protection is enabled by default). You can only delete a DB cluster if its DeletionProtection field is set to false.

May throw DBClusterAlreadyExistsFault. May throw InsufficientStorageClusterCapacityFault. May throw DBClusterQuotaExceededFault. May throw StorageQuotaExceededFault. May throw DBSubnetGroupNotFoundFault. May throw InvalidVPCNetworkStateFault. May throw InvalidDBClusterStateFault. May throw InvalidDBSubnetGroupStateFault. May throw InvalidSubnet. May throw InvalidDBInstanceStateFault. May throw DBClusterParameterGroupNotFoundFault. May throw KMSKeyNotAccessibleFault. May throw DBClusterNotFoundFault. May throw DBInstanceNotFoundFault. May throw DBSubnetGroupDoesNotCoverEnoughAZs.

Parameter dBClusterIdentifier : The DB cluster identifier. This parameter is stored as a lowercase string.

Constraints:

  • Must contain from 1 to 63 letters, numbers, or hyphens.
  • First character must be a letter.
  • Cannot end with a hyphen or contain two consecutive hyphens.
Example: my-cluster1

Parameter engine : The name of the database engine to be used for this DB cluster.

Valid Values: neptune

Parameter availabilityZones : A list of EC2 Availability Zones that instances in the DB cluster can be created in.

Parameter backupRetentionPeriod : The number of days for which automated backups are retained. You must specify a minimum value of 1.

Default: 1

Constraints:

  • Must be a value from 1 to 35

Parameter characterSetName : (Not supported by Neptune)

Parameter dBClusterParameterGroupName : The name of the DB cluster parameter group to associate with this DB cluster. If this argument is omitted, the default is used.

Constraints:

  • If supplied, must match the name of an existing DBClusterParameterGroup.

Parameter dBSubnetGroupName : A DB subnet group to associate with this DB cluster.

Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.

Example: mySubnetgroup

Parameter databaseName : The name for your database of up to 64 alpha-numeric characters. If you do not provide a name, Amazon Neptune will not create a database in the DB cluster you are creating.

Parameter deletionProtection : A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is enabled.

Parameter enableCloudwatchLogsExports : The list of log types that need to be enabled for exporting to CloudWatch Logs.

Parameter enableIAMDatabaseAuthentication : Not supported by Neptune.

Parameter engineVersion : The version number of the database engine to use for the new DB cluster.

Example: 1.0.2.1

Parameter kmsKeyId : The AWS KMS key identifier for an encrypted DB cluster.

The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a DB cluster with the same AWS account that owns the KMS encryption key used to encrypt the new DB cluster, then you can use the KMS key alias instead of the ARN for the KMS encryption key.

If an encryption key is not specified in KmsKeyId:

  • If ReplicationSourceIdentifier identifies an encrypted source, then Amazon Neptune will use the encryption key used to encrypt the source. Otherwise, Amazon Neptune will use your default encryption key.
  • If the StorageEncrypted parameter is true and ReplicationSourceIdentifier is not specified, then Amazon Neptune will use your default encryption key.
AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default encryption key for each AWS Region.

If you create a Read Replica of an encrypted DB cluster in another AWS Region, you must set KmsKeyId to a KMS key ID that is valid in the destination AWS Region. This key is used to encrypt the Read Replica in that AWS Region.

Parameter masterUserPassword : The password for the master database user. This password can contain any printable ASCII character except "/", """, or "@".

Constraints: Must contain from 8 to 41 characters.

Parameter masterUsername : The name of the master user for the DB cluster.

Constraints:

  • Must be 1 to 16 letters or numbers.
  • First character must be a letter.
  • Cannot be a reserved word for the chosen database engine.

Parameter optionGroupName : (Not supported by Neptune)

Parameter port : The port number on which the instances in the DB cluster accept connections.

Default: 8182

Parameter preSignedUrl : This parameter is not currently supported.

Parameter preferredBackupWindow : The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.

The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see Adjusting the Preferred Maintenance Window in the Amazon Neptune User Guide.

Constraints:

  • Must be in the format hh24:mi-hh24:mi.
  • Must be in Universal Coordinated Time (UTC).
  • Must not conflict with the preferred maintenance window.
  • Must be at least 30 minutes.

Parameter preferredMaintenanceWindow : The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).

Format: ddd:hh24:mi-ddd:hh24:mi

The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week. To see the time blocks available, see Adjusting the Preferred Maintenance Window in the Amazon Neptune User Guide.

Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.

Constraints: Minimum 30-minute window.

Parameter replicationSourceIdentifier : The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a Read Replica.

Parameter storageEncrypted : Specifies whether the DB cluster is encrypted.

Parameter tags : The tags to assign to the new DB cluster.

Parameter vpcSecurityGroupIds : A list of EC2 VPC security groups to associate with this DB cluster.

Implementation

Future<CreateDBClusterResult> createDBCluster({
  required String dBClusterIdentifier,
  required String engine,
  List<String>? availabilityZones,
  int? backupRetentionPeriod,
  String? characterSetName,
  String? dBClusterParameterGroupName,
  String? dBSubnetGroupName,
  String? databaseName,
  bool? deletionProtection,
  List<String>? enableCloudwatchLogsExports,
  bool? enableIAMDatabaseAuthentication,
  String? engineVersion,
  String? kmsKeyId,
  String? masterUserPassword,
  String? masterUsername,
  String? optionGroupName,
  int? port,
  String? preSignedUrl,
  String? preferredBackupWindow,
  String? preferredMaintenanceWindow,
  String? replicationSourceIdentifier,
  bool? storageEncrypted,
  List<Tag>? tags,
  List<String>? vpcSecurityGroupIds,
}) async {
  ArgumentError.checkNotNull(dBClusterIdentifier, 'dBClusterIdentifier');
  ArgumentError.checkNotNull(engine, 'engine');
  final $request = <String, dynamic>{};
  $request['DBClusterIdentifier'] = dBClusterIdentifier;
  $request['Engine'] = engine;
  availabilityZones?.also((arg) => $request['AvailabilityZones'] = arg);
  backupRetentionPeriod
      ?.also((arg) => $request['BackupRetentionPeriod'] = arg);
  characterSetName?.also((arg) => $request['CharacterSetName'] = arg);
  dBClusterParameterGroupName
      ?.also((arg) => $request['DBClusterParameterGroupName'] = arg);
  dBSubnetGroupName?.also((arg) => $request['DBSubnetGroupName'] = arg);
  databaseName?.also((arg) => $request['DatabaseName'] = arg);
  deletionProtection?.also((arg) => $request['DeletionProtection'] = arg);
  enableCloudwatchLogsExports
      ?.also((arg) => $request['EnableCloudwatchLogsExports'] = arg);
  enableIAMDatabaseAuthentication
      ?.also((arg) => $request['EnableIAMDatabaseAuthentication'] = arg);
  engineVersion?.also((arg) => $request['EngineVersion'] = arg);
  kmsKeyId?.also((arg) => $request['KmsKeyId'] = arg);
  masterUserPassword?.also((arg) => $request['MasterUserPassword'] = arg);
  masterUsername?.also((arg) => $request['MasterUsername'] = arg);
  optionGroupName?.also((arg) => $request['OptionGroupName'] = arg);
  port?.also((arg) => $request['Port'] = arg);
  preSignedUrl?.also((arg) => $request['PreSignedUrl'] = arg);
  preferredBackupWindow
      ?.also((arg) => $request['PreferredBackupWindow'] = arg);
  preferredMaintenanceWindow
      ?.also((arg) => $request['PreferredMaintenanceWindow'] = arg);
  replicationSourceIdentifier
      ?.also((arg) => $request['ReplicationSourceIdentifier'] = arg);
  storageEncrypted?.also((arg) => $request['StorageEncrypted'] = arg);
  tags?.also((arg) => $request['Tags'] = arg);
  vpcSecurityGroupIds?.also((arg) => $request['VpcSecurityGroupIds'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'CreateDBCluster',
    version: '2014-10-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['CreateDBClusterMessage'],
    shapes: shapes,
    resultWrapper: 'CreateDBClusterResult',
  );
  return CreateDBClusterResult.fromXml($result);
}