createDBInstance method
- required String dBInstanceClass,
- required String dBInstanceIdentifier,
- required String engine,
- int? allocatedStorage,
- bool? autoMinorVersionUpgrade,
- String? availabilityZone,
- int? backupRetentionPeriod,
- String? characterSetName,
- bool? copyTagsToSnapshot,
- String? dBClusterIdentifier,
- String? dBName,
- String? dBParameterGroupName,
- List<
String> ? dBSecurityGroups, - String? dBSubnetGroupName,
- bool? deletionProtection,
- String? domain,
- String? domainIAMRoleName,
- List<
String> ? enableCloudwatchLogsExports, - bool? enableIAMDatabaseAuthentication,
- bool? enablePerformanceInsights,
- String? engineVersion,
- int? iops,
- String? kmsKeyId,
- String? licenseModel,
- String? masterUserPassword,
- String? masterUsername,
- int? monitoringInterval,
- String? monitoringRoleArn,
- bool? multiAZ,
- String? optionGroupName,
- String? performanceInsightsKMSKeyId,
- int? port,
- String? preferredBackupWindow,
- String? preferredMaintenanceWindow,
- int? promotionTier,
- bool? publiclyAccessible,
- bool? storageEncrypted,
- String? storageType,
- List<
Tag> ? tags, - String? tdeCredentialArn,
- String? tdeCredentialPassword,
- String? timezone,
- List<
String> ? vpcSecurityGroupIds,
Creates a new DB instance.
May throw DBInstanceAlreadyExistsFault. May throw InsufficientDBInstanceCapacityFault. May throw DBParameterGroupNotFoundFault. May throw DBSecurityGroupNotFoundFault. May throw InstanceQuotaExceededFault. May throw StorageQuotaExceededFault. May throw DBSubnetGroupNotFoundFault. May throw DBSubnetGroupDoesNotCoverEnoughAZs. May throw InvalidDBClusterStateFault. May throw InvalidSubnet. May throw InvalidVPCNetworkStateFault. May throw ProvisionedIopsNotAvailableInAZFault. May throw OptionGroupNotFoundFault. May throw DBClusterNotFoundFault. May throw StorageTypeNotSupportedFault. May throw AuthorizationNotFoundFault. May throw KMSKeyNotAccessibleFault. May throw DomainNotFoundFault.
Parameter dBInstanceClass
:
The compute and memory capacity of the DB instance, for example,
db.m4.large
. Not all DB instance classes are available in all
AWS Regions.
Parameter dBInstanceIdentifier
:
The DB instance 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.
mydbinstance
Parameter engine
:
The name of the database engine to be used for this instance.
Valid Values: neptune
Parameter allocatedStorage
:
The amount of storage (in gibibytes) to allocate for the DB instance.
Type: Integer
Not applicable. Neptune cluster volumes automatically grow as the amount of data in your database increases, though you are only charged for the space that you use in a Neptune cluster volume.
Parameter autoMinorVersionUpgrade
:
Indicates that minor engine upgrades are applied automatically to the DB
instance during the maintenance window.
Default: true
Parameter availabilityZone
:
The EC2 Availability Zone that the DB instance is created in
Default: A random, system-chosen Availability Zone in the endpoint's AWS Region.
Example: us-east-1d
Constraint: The AvailabilityZone parameter can't be specified if the
MultiAZ parameter is set to true
. The specified Availability
Zone must be in the same AWS Region as the current endpoint.
Parameter backupRetentionPeriod
:
The number of days for which automated backups are retained.
Not applicable. The retention period for automated backups is managed by the DB cluster. For more information, see CreateDBCluster.
Default: 1
Constraints:
- Must be a value from 0 to 35
- Cannot be set to 0 if the DB instance is a source to Read Replicas
Parameter characterSetName
:
(Not supported by Neptune)
Parameter copyTagsToSnapshot
:
True to copy all tags from the DB instance to snapshots of the DB
instance, and otherwise false. The default is false.
Parameter dBClusterIdentifier
:
The identifier of the DB cluster that the instance will belong to.
For information on creating a DB cluster, see CreateDBCluster.
Type: String
Parameter dBName
:
Not supported.
Parameter dBParameterGroupName
:
The name of the DB parameter group to associate with this DB instance. If
this argument is omitted, the default DBParameterGroup for the specified
engine is used.
Constraints:
- Must be 1 to 255 letters, numbers, or hyphens.
- First character must be a letter
- Cannot end with a hyphen or contain two consecutive hyphens
Parameter dBSecurityGroups
:
A list of DB security groups to associate with this DB instance.
Default: The default DB security group for the database engine.
Parameter dBSubnetGroupName
:
A DB subnet group to associate with this DB instance.
If there is no DB subnet group, then it is a non-VPC DB instance.
Parameter deletionProtection
:
A value that indicates whether the DB instance has deletion protection
enabled. The database can't be deleted when deletion protection is
enabled. By default, deletion protection is disabled. See Deleting
a DB Instance.
DB instances in a DB cluster can be deleted even when deletion protection is enabled in their parent DB cluster.
Parameter domain
:
Specify the Active Directory Domain to create the instance in.
Parameter domainIAMRoleName
:
Specify the name of the IAM role to be used when making API calls to the
Directory Service.
Parameter enableCloudwatchLogsExports
:
The list of log types that need to be enabled for exporting to CloudWatch
Logs.
Parameter enableIAMDatabaseAuthentication
:
True to enable AWS Identity and Access Management (IAM) authentication for
Neptune.
Default: false
Parameter enablePerformanceInsights
:
(Not supported by Neptune)
Parameter engineVersion
:
The version number of the database engine to use. Currently, setting this
parameter has no effect.
Parameter iops
:
The amount of Provisioned IOPS (input/output operations per second) to be
initially allocated for the DB instance.
Parameter kmsKeyId
:
The AWS KMS key identifier for an encrypted DB instance.
The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a DB instance with the same AWS account that owns the KMS encryption key used to encrypt the new DB instance, then you can use the KMS key alias instead of the ARN for the KM encryption key.
Not applicable. The KMS key identifier is managed by the DB cluster. For more information, see CreateDBCluster.
If the StorageEncrypted
parameter is true, and you do not
specify a value for the KmsKeyId
parameter, 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.
Parameter licenseModel
:
License model information for this DB instance.
Valid values: license-included
|
bring-your-own-license
| general-public-license
Parameter masterUserPassword
:
The password for the master user. The password can include any printable
ASCII character except "/", """, or "@".
Not used.
Parameter masterUsername
:
The name for the master user. Not used.
Parameter monitoringInterval
:
The interval, in seconds, between points when Enhanced Monitoring metrics
are collected for the DB instance. To disable collecting Enhanced
Monitoring metrics, specify 0. The default is 0.
If MonitoringRoleArn
is specified, then you must also set
MonitoringInterval
to a value other than 0.
Valid Values: 0, 1, 5, 10, 15, 30, 60
Parameter monitoringRoleArn
:
The ARN for the IAM role that permits Neptune to send enhanced monitoring
metrics to Amazon CloudWatch Logs. For example,
arn:aws:iam:123456789012:role/emaccess
.
If MonitoringInterval
is set to a value other than 0, then
you must supply a MonitoringRoleArn
value.
Parameter multiAZ
:
Specifies if the DB instance is a Multi-AZ deployment. You can't set the
AvailabilityZone parameter if the MultiAZ parameter is set to true.
Parameter optionGroupName
:
(Not supported by Neptune)
Parameter performanceInsightsKMSKeyId
:
(Not supported by Neptune)
Parameter port
:
The port number on which the database accepts connections.
Not applicable. The port is managed by the DB cluster. For more information, see CreateDBCluster.
Default: 8182
Type: Integer
Parameter preferredBackupWindow
:
The daily time range during which automated backups are created.
Not applicable. The daily time range for creating automated backups is managed by the DB cluster. For more information, see CreateDBCluster.
Parameter preferredMaintenanceWindow
:
The time range each week 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.
Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
Constraints: Minimum 30-minute window.
Parameter promotionTier
:
A value that specifies the order in which an Read Replica is promoted to
the primary instance after a failure of the existing primary instance.
Default: 1
Valid Values: 0 - 15
Parameter publiclyAccessible
:
This flag should no longer be used.
Parameter storageEncrypted
:
Specifies whether the DB instance is encrypted.
Not applicable. The encryption for DB instances is managed by the DB cluster. For more information, see CreateDBCluster.
Default: false
Parameter storageType
:
Specifies the storage type to be associated with the DB instance.
Not applicable. Storage is managed by the DB Cluster.
Parameter tags
:
The tags to assign to the new instance.
Parameter tdeCredentialArn
:
The ARN from the key store with which to associate the instance for TDE
encryption.
Parameter tdeCredentialPassword
:
The password for the given ARN from the key store in order to access the
device.
Parameter timezone
:
The time zone of the DB instance.
Parameter vpcSecurityGroupIds
:
A list of EC2 VPC security groups to associate with this DB instance.
Not applicable. The associated list of EC2 VPC security groups is managed by the DB cluster. For more information, see CreateDBCluster.
Default: The default EC2 VPC security group for the DB subnet group's VPC.
Implementation
Future<CreateDBInstanceResult> createDBInstance({
required String dBInstanceClass,
required String dBInstanceIdentifier,
required String engine,
int? allocatedStorage,
bool? autoMinorVersionUpgrade,
String? availabilityZone,
int? backupRetentionPeriod,
String? characterSetName,
bool? copyTagsToSnapshot,
String? dBClusterIdentifier,
String? dBName,
String? dBParameterGroupName,
List<String>? dBSecurityGroups,
String? dBSubnetGroupName,
bool? deletionProtection,
String? domain,
String? domainIAMRoleName,
List<String>? enableCloudwatchLogsExports,
bool? enableIAMDatabaseAuthentication,
bool? enablePerformanceInsights,
String? engineVersion,
int? iops,
String? kmsKeyId,
String? licenseModel,
String? masterUserPassword,
String? masterUsername,
int? monitoringInterval,
String? monitoringRoleArn,
bool? multiAZ,
String? optionGroupName,
String? performanceInsightsKMSKeyId,
int? port,
String? preferredBackupWindow,
String? preferredMaintenanceWindow,
int? promotionTier,
bool? publiclyAccessible,
bool? storageEncrypted,
String? storageType,
List<Tag>? tags,
String? tdeCredentialArn,
String? tdeCredentialPassword,
String? timezone,
List<String>? vpcSecurityGroupIds,
}) async {
ArgumentError.checkNotNull(dBInstanceClass, 'dBInstanceClass');
ArgumentError.checkNotNull(dBInstanceIdentifier, 'dBInstanceIdentifier');
ArgumentError.checkNotNull(engine, 'engine');
final $request = <String, dynamic>{};
$request['DBInstanceClass'] = dBInstanceClass;
$request['DBInstanceIdentifier'] = dBInstanceIdentifier;
$request['Engine'] = engine;
allocatedStorage?.also((arg) => $request['AllocatedStorage'] = arg);
autoMinorVersionUpgrade
?.also((arg) => $request['AutoMinorVersionUpgrade'] = arg);
availabilityZone?.also((arg) => $request['AvailabilityZone'] = arg);
backupRetentionPeriod
?.also((arg) => $request['BackupRetentionPeriod'] = arg);
characterSetName?.also((arg) => $request['CharacterSetName'] = arg);
copyTagsToSnapshot?.also((arg) => $request['CopyTagsToSnapshot'] = arg);
dBClusterIdentifier?.also((arg) => $request['DBClusterIdentifier'] = arg);
dBName?.also((arg) => $request['DBName'] = arg);
dBParameterGroupName?.also((arg) => $request['DBParameterGroupName'] = arg);
dBSecurityGroups?.also((arg) => $request['DBSecurityGroups'] = arg);
dBSubnetGroupName?.also((arg) => $request['DBSubnetGroupName'] = arg);
deletionProtection?.also((arg) => $request['DeletionProtection'] = arg);
domain?.also((arg) => $request['Domain'] = arg);
domainIAMRoleName?.also((arg) => $request['DomainIAMRoleName'] = arg);
enableCloudwatchLogsExports
?.also((arg) => $request['EnableCloudwatchLogsExports'] = arg);
enableIAMDatabaseAuthentication
?.also((arg) => $request['EnableIAMDatabaseAuthentication'] = arg);
enablePerformanceInsights
?.also((arg) => $request['EnablePerformanceInsights'] = arg);
engineVersion?.also((arg) => $request['EngineVersion'] = arg);
iops?.also((arg) => $request['Iops'] = arg);
kmsKeyId?.also((arg) => $request['KmsKeyId'] = arg);
licenseModel?.also((arg) => $request['LicenseModel'] = arg);
masterUserPassword?.also((arg) => $request['MasterUserPassword'] = arg);
masterUsername?.also((arg) => $request['MasterUsername'] = arg);
monitoringInterval?.also((arg) => $request['MonitoringInterval'] = arg);
monitoringRoleArn?.also((arg) => $request['MonitoringRoleArn'] = arg);
multiAZ?.also((arg) => $request['MultiAZ'] = arg);
optionGroupName?.also((arg) => $request['OptionGroupName'] = arg);
performanceInsightsKMSKeyId
?.also((arg) => $request['PerformanceInsightsKMSKeyId'] = arg);
port?.also((arg) => $request['Port'] = arg);
preferredBackupWindow
?.also((arg) => $request['PreferredBackupWindow'] = arg);
preferredMaintenanceWindow
?.also((arg) => $request['PreferredMaintenanceWindow'] = arg);
promotionTier?.also((arg) => $request['PromotionTier'] = arg);
publiclyAccessible?.also((arg) => $request['PubliclyAccessible'] = arg);
storageEncrypted?.also((arg) => $request['StorageEncrypted'] = arg);
storageType?.also((arg) => $request['StorageType'] = arg);
tags?.also((arg) => $request['Tags'] = arg);
tdeCredentialArn?.also((arg) => $request['TdeCredentialArn'] = arg);
tdeCredentialPassword
?.also((arg) => $request['TdeCredentialPassword'] = arg);
timezone?.also((arg) => $request['Timezone'] = arg);
vpcSecurityGroupIds?.also((arg) => $request['VpcSecurityGroupIds'] = arg);
final $result = await _protocol.send(
$request,
action: 'CreateDBInstance',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['CreateDBInstanceMessage'],
shapes: shapes,
resultWrapper: 'CreateDBInstanceResult',
);
return CreateDBInstanceResult.fromXml($result);
}