createDbInstance method
- required int allocatedStorage,
- required DbInstanceType dbInstanceType,
- required String name,
- required String password,
- required List<
String> vpcSecurityGroupIds, - required List<
String> vpcSubnetIds, - String? bucket,
- String? dbParameterGroupIdentifier,
- DbStorageType? dbStorageType,
- DeploymentType? deploymentType,
- LogDeliveryConfiguration? logDeliveryConfiguration,
- MaintenanceSchedule? maintenanceSchedule,
- NetworkType? networkType,
- String? organization,
- int? port,
- bool? publiclyAccessible,
- Map<
String, String> ? tags, - String? username,
Creates a new Timestream for InfluxDB DB instance.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter allocatedStorage :
The amount of storage to allocate for your DB storage type in GiB
(gibibytes).
Parameter dbInstanceType :
The Timestream for InfluxDB DB instance type to run InfluxDB on.
Parameter name :
The name that uniquely identifies the DB instance when interacting with
the Amazon Timestream for InfluxDB API and CLI commands. This name will
also be a prefix included in the endpoint. DB instance names must be
unique per customer and per region.
Parameter password :
The password of the initial admin user created in InfluxDB v2. 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 vpcSecurityGroupIds :
A list of VPC security group IDs to associate with the DB instance.
Parameter vpcSubnetIds :
A list of VPC subnet IDs to associate with the DB instance. Provide at
least two VPC subnet IDs in different availability zones when deploying
with a Multi-AZ standby.
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 instance. 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 3 different types of provisioned Influx IOPS included storage according to your workloads requirements:
- Influx IO Included 3000 IOPS
- Influx IO Included 12000 IOPS
- Influx IO Included 16000 IOPS
Parameter deploymentType :
Specifies whether the DB instance will be deployed as a standalone
instance or with a Multi-AZ standby for high availability.
Parameter logDeliveryConfiguration :
Configuration for sending InfluxDB engine logs to a specified S3 bucket.
Parameter maintenanceSchedule :
Specifies the maintenance schedule for the DB instance, including the
preferred maintenance window and timezone.
Parameter networkType :
Specifies whether the networkType of the Timestream for InfluxDB instance
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 port :
The port number on which InfluxDB accepts connections.
Valid Values: 1024-65535
Default: 8086
Constraints: The value can't be 2375-2376, 7788-7799, 8090, or 51678-51680
Parameter publiclyAccessible :
Configures the DB instance with a public IP to facilitate access.
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 Amazon Secrets Manager in your account.
Implementation
Future<CreateDbInstanceOutput> createDbInstance({
required int allocatedStorage,
required DbInstanceType dbInstanceType,
required String name,
required String password,
required List<String> vpcSecurityGroupIds,
required List<String> vpcSubnetIds,
String? bucket,
String? dbParameterGroupIdentifier,
DbStorageType? dbStorageType,
DeploymentType? deploymentType,
LogDeliveryConfiguration? logDeliveryConfiguration,
MaintenanceSchedule? maintenanceSchedule,
NetworkType? networkType,
String? organization,
int? port,
bool? publiclyAccessible,
Map<String, String>? tags,
String? username,
}) async {
_s.validateNumRange(
'allocatedStorage',
allocatedStorage,
20,
15360,
isRequired: true,
);
_s.validateNumRange(
'port',
port,
1024,
65535,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AmazonTimestreamInfluxDB.CreateDbInstance'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'allocatedStorage': allocatedStorage,
'dbInstanceType': dbInstanceType.value,
'name': name,
'password': password,
'vpcSecurityGroupIds': vpcSecurityGroupIds,
'vpcSubnetIds': vpcSubnetIds,
if (bucket != null) 'bucket': bucket,
if (dbParameterGroupIdentifier != null)
'dbParameterGroupIdentifier': dbParameterGroupIdentifier,
if (dbStorageType != null) 'dbStorageType': dbStorageType.value,
if (deploymentType != null) 'deploymentType': deploymentType.value,
if (logDeliveryConfiguration != null)
'logDeliveryConfiguration': logDeliveryConfiguration,
if (maintenanceSchedule != null)
'maintenanceSchedule': maintenanceSchedule,
if (networkType != null) 'networkType': networkType.value,
if (organization != null) 'organization': organization,
if (port != null) 'port': port,
if (publiclyAccessible != null)
'publiclyAccessible': publiclyAccessible,
if (tags != null) 'tags': tags,
if (username != null) 'username': username,
},
);
return CreateDbInstanceOutput.fromJson(jsonResponse.body);
}