createDbCluster method

Future<CreateDbClusterOutput> createDbCluster({
  1. required DbInstanceType dbInstanceType,
  2. required String name,
  3. required List<String> vpcSecurityGroupIds,
  4. required List<String> vpcSubnetIds,
  5. int? allocatedStorage,
  6. String? bucket,
  7. String? dbParameterGroupIdentifier,
  8. DbStorageType? dbStorageType,
  9. ClusterDeploymentType? deploymentType,
  10. FailoverMode? failoverMode,
  11. LogDeliveryConfiguration? logDeliveryConfiguration,
  12. MaintenanceSchedule? maintenanceSchedule,
  13. NetworkType? networkType,
  14. String? organization,
  15. String? password,
  16. int? port,
  17. bool? publiclyAccessible,
  18. Map<String, String>? tags,
  19. String? username,
})

Creates a new Timestream for InfluxDB cluster.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter dbInstanceType : The Timestream for InfluxDB DB instance type to run InfluxDB on.

Parameter name : The name that uniquely identifies the DB cluster when interacting with the Amazon Timestream for InfluxDB API and CLI commands. This name will also be a prefix included in the endpoint. DB cluster names must be unique per customer and per region.

Parameter vpcSecurityGroupIds : A list of VPC security group IDs to associate with the Timestream for InfluxDB cluster.

Parameter vpcSubnetIds : A list of VPC subnet IDs to associate with the DB cluster. Provide at least two VPC subnet IDs in different Availability Zones when deploying with a Multi-AZ standby.

Parameter allocatedStorage : The amount of storage to allocate for your DB storage type in GiB (gibibytes).

Parameter bucket : The name of the initial InfluxDB bucket. All InfluxDB data is stored in a bucket. A bucket combines the concept of a database and a retention period (the duration of time that each data point persists). A bucket belongs to an organization.

Parameter dbParameterGroupIdentifier : The ID of the DB parameter group to assign to your DB cluster. DB parameter groups specify how the database is configured. For example, DB parameter groups can specify the limit for query concurrency.

Parameter dbStorageType : The Timestream for InfluxDB DB storage type to read and write InfluxDB data.

You can choose between three different types of provisioned Influx IOPS Included storage according to your workload requirements:

  • Influx I/O Included 3000 IOPS
  • Influx I/O Included 12000 IOPS
  • Influx I/O Included 16000 IOPS

Parameter deploymentType : Specifies the type of cluster to create.

Parameter failoverMode : Specifies the behavior of failure recovery when the primary node of the cluster fails.

Parameter logDeliveryConfiguration : Configuration for sending InfluxDB engine logs to a specified S3 bucket.

Parameter maintenanceSchedule : Specifies the maintenance schedule for the DB cluster, including the preferred maintenance window and timezone.

Parameter networkType : Specifies whether the network type of the Timestream for InfluxDB cluster is IPv4, which can communicate over IPv4 protocol only, or DUAL, which can communicate over both IPv4 and IPv6 protocols.

Parameter organization : The name of the initial organization for the initial admin user in InfluxDB. An InfluxDB organization is a workspace for a group of users.

Parameter password : The password of the initial admin user created in InfluxDB. This password will allow you to access the InfluxDB UI to perform various administrative tasks and also use the InfluxDB CLI to create an operator token. These attributes will be stored in a secret created in Secrets Manager in your account.

Parameter port : The port number on which InfluxDB accepts connections.

Valid Values: 1024-65535

Default: 8086 for InfluxDB v2, 8181 for InfluxDB v3

Constraints: The value can't be 2375-2376, 7788-7799, 8090, or 51678-51680

Parameter publiclyAccessible : Configures the Timestream for InfluxDB cluster with a public IP to facilitate access from outside the VPC.

Parameter tags : A list of key-value pairs to associate with the DB instance.

Parameter username : The username of the initial admin user created in InfluxDB. Must start with a letter and can't end with a hyphen or contain two consecutive hyphens. For example, my-user1. This username will allow you to access the InfluxDB UI to perform various administrative tasks and also use the InfluxDB CLI to create an operator token. These attributes will be stored in a secret created in Secrets Manager in your account.

Implementation

Future<CreateDbClusterOutput> createDbCluster({
  required DbInstanceType dbInstanceType,
  required String name,
  required List<String> vpcSecurityGroupIds,
  required List<String> vpcSubnetIds,
  int? allocatedStorage,
  String? bucket,
  String? dbParameterGroupIdentifier,
  DbStorageType? dbStorageType,
  ClusterDeploymentType? deploymentType,
  FailoverMode? failoverMode,
  LogDeliveryConfiguration? logDeliveryConfiguration,
  MaintenanceSchedule? maintenanceSchedule,
  NetworkType? networkType,
  String? organization,
  String? password,
  int? port,
  bool? publiclyAccessible,
  Map<String, String>? tags,
  String? username,
}) async {
  _s.validateNumRange(
    'allocatedStorage',
    allocatedStorage,
    20,
    15360,
  );
  _s.validateNumRange(
    'port',
    port,
    1024,
    65535,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonTimestreamInfluxDB.CreateDbCluster'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'dbInstanceType': dbInstanceType.value,
      'name': name,
      'vpcSecurityGroupIds': vpcSecurityGroupIds,
      'vpcSubnetIds': vpcSubnetIds,
      if (allocatedStorage != null) 'allocatedStorage': allocatedStorage,
      if (bucket != null) 'bucket': bucket,
      if (dbParameterGroupIdentifier != null)
        'dbParameterGroupIdentifier': dbParameterGroupIdentifier,
      if (dbStorageType != null) 'dbStorageType': dbStorageType.value,
      if (deploymentType != null) 'deploymentType': deploymentType.value,
      if (failoverMode != null) 'failoverMode': failoverMode.value,
      if (logDeliveryConfiguration != null)
        'logDeliveryConfiguration': logDeliveryConfiguration,
      if (maintenanceSchedule != null)
        'maintenanceSchedule': maintenanceSchedule,
      if (networkType != null) 'networkType': networkType.value,
      if (organization != null) 'organization': organization,
      if (password != null) 'password': password,
      if (port != null) 'port': port,
      if (publiclyAccessible != null)
        'publiclyAccessible': publiclyAccessible,
      if (tags != null) 'tags': tags,
      if (username != null) 'username': username,
    },
  );

  return CreateDbClusterOutput.fromJson(jsonResponse.body);
}