createDBInstance method
- required String dBClusterIdentifier,
- required String dBInstanceClass,
- required String dBInstanceIdentifier,
- required String engine,
- int? allocatedStorage,
- bool? autoMinorVersionUpgrade,
- String? availabilityZone,
- int? backupRetentionPeriod,
- String? characterSetName,
- bool? copyTagsToSnapshot,
- 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 AuthorizationNotFoundFault.
May throw DBClusterNotFoundFault.
May throw DBInstanceAlreadyExistsFault.
May throw DBParameterGroupNotFoundFault.
May throw DBSecurityGroupNotFoundFault.
May throw DBSubnetGroupDoesNotCoverEnoughAZs.
May throw DBSubnetGroupNotFoundFault.
May throw DomainNotFoundFault.
May throw InstanceQuotaExceededFault.
May throw InsufficientDBInstanceCapacityFault.
May throw InvalidDBClusterStateFault.
May throw InvalidSubnet.
May throw InvalidVPCNetworkStateFault.
May throw KMSKeyNotAccessibleFault.
May throw OptionGroupNotFoundFault.
May throw ProvisionedIopsNotAvailableInAZFault.
May throw StorageQuotaExceededFault.
May throw StorageTypeNotSupportedFault.
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 dBInstanceClass :
The compute and memory capacity of the DB instance, for example,
db.m4.large. Not all DB instance classes are available in all
Amazon 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 :
Not supported by Neptune.
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 Amazon 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 Amazon 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 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 :
Not supported by Neptune (ignored).
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 Amazon 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 Amazon 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 KMS 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. Amazon KMS creates the
default encryption key for your Amazon account. Your Amazon account has a
different default encryption key for each Amazon Region.
Parameter licenseModel :
License model information for this DB instance.
Valid values: license-included |
bring-your-own-license | general-public-license
Parameter masterUserPassword :
Not supported by Neptune.
Parameter masterUsername :
Not supported by Neptune.
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 Amazon 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 :
Indicates whether the DB instance is publicly accessible.
When the DB instance is publicly accessible and you connect from outside of the DB instance's virtual private cloud (VPC), its Domain Name System (DNS) endpoint resolves to the public IP address. When you connect from within the same VPC as the DB instance, the endpoint resolves to the private IP address. Access to the DB instance is ultimately controlled by the security group it uses. That public access isn't permitted if the security group assigned to the DB cluster doesn't permit it.
When the DB instance isn't publicly accessible, it is an internal DB instance with a DNS name that resolves to a private IP address.
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 :
Not applicable. In Neptune the storage type is managed at the DB Cluster
level.
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 dBClusterIdentifier,
required String dBInstanceClass,
required String dBInstanceIdentifier,
required String engine,
int? allocatedStorage,
bool? autoMinorVersionUpgrade,
String? availabilityZone,
int? backupRetentionPeriod,
String? characterSetName,
bool? copyTagsToSnapshot,
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 {
final $request = <String, String>{
'DBClusterIdentifier': dBClusterIdentifier,
'DBInstanceClass': dBInstanceClass,
'DBInstanceIdentifier': dBInstanceIdentifier,
'Engine': engine,
if (allocatedStorage != null)
'AllocatedStorage': allocatedStorage.toString(),
if (autoMinorVersionUpgrade != null)
'AutoMinorVersionUpgrade': autoMinorVersionUpgrade.toString(),
if (availabilityZone != null) 'AvailabilityZone': availabilityZone,
if (backupRetentionPeriod != null)
'BackupRetentionPeriod': backupRetentionPeriod.toString(),
if (characterSetName != null) 'CharacterSetName': characterSetName,
if (copyTagsToSnapshot != null)
'CopyTagsToSnapshot': copyTagsToSnapshot.toString(),
if (dBName != null) 'DBName': dBName,
if (dBParameterGroupName != null)
'DBParameterGroupName': dBParameterGroupName,
if (dBSecurityGroups != null)
if (dBSecurityGroups.isEmpty)
'DBSecurityGroups': ''
else
for (var i1 = 0; i1 < dBSecurityGroups.length; i1++)
'DBSecurityGroups.DBSecurityGroupName.${i1 + 1}':
dBSecurityGroups[i1],
if (dBSubnetGroupName != null) 'DBSubnetGroupName': dBSubnetGroupName,
if (deletionProtection != null)
'DeletionProtection': deletionProtection.toString(),
if (domain != null) 'Domain': domain,
if (domainIAMRoleName != null) 'DomainIAMRoleName': domainIAMRoleName,
if (enableCloudwatchLogsExports != null)
if (enableCloudwatchLogsExports.isEmpty)
'EnableCloudwatchLogsExports': ''
else
for (var i1 = 0; i1 < enableCloudwatchLogsExports.length; i1++)
'EnableCloudwatchLogsExports.member.${i1 + 1}':
enableCloudwatchLogsExports[i1],
if (enableIAMDatabaseAuthentication != null)
'EnableIAMDatabaseAuthentication':
enableIAMDatabaseAuthentication.toString(),
if (enablePerformanceInsights != null)
'EnablePerformanceInsights': enablePerformanceInsights.toString(),
if (engineVersion != null) 'EngineVersion': engineVersion,
if (iops != null) 'Iops': iops.toString(),
if (kmsKeyId != null) 'KmsKeyId': kmsKeyId,
if (licenseModel != null) 'LicenseModel': licenseModel,
if (masterUserPassword != null) 'MasterUserPassword': masterUserPassword,
if (masterUsername != null) 'MasterUsername': masterUsername,
if (monitoringInterval != null)
'MonitoringInterval': monitoringInterval.toString(),
if (monitoringRoleArn != null) 'MonitoringRoleArn': monitoringRoleArn,
if (multiAZ != null) 'MultiAZ': multiAZ.toString(),
if (optionGroupName != null) 'OptionGroupName': optionGroupName,
if (performanceInsightsKMSKeyId != null)
'PerformanceInsightsKMSKeyId': performanceInsightsKMSKeyId,
if (port != null) 'Port': port.toString(),
if (preferredBackupWindow != null)
'PreferredBackupWindow': preferredBackupWindow,
if (preferredMaintenanceWindow != null)
'PreferredMaintenanceWindow': preferredMaintenanceWindow,
if (promotionTier != null) 'PromotionTier': promotionTier.toString(),
if (publiclyAccessible != null)
'PubliclyAccessible': publiclyAccessible.toString(),
if (storageEncrypted != null)
'StorageEncrypted': storageEncrypted.toString(),
if (storageType != null) 'StorageType': storageType,
if (tags != null)
if (tags.isEmpty)
'Tags': ''
else
for (var i1 = 0; i1 < tags.length; i1++)
for (var e3 in tags[i1].toQueryMap().entries)
'Tags.Tag.${i1 + 1}.${e3.key}': e3.value,
if (tdeCredentialArn != null) 'TdeCredentialArn': tdeCredentialArn,
if (tdeCredentialPassword != null)
'TdeCredentialPassword': tdeCredentialPassword,
if (timezone != null) 'Timezone': timezone,
if (vpcSecurityGroupIds != null)
if (vpcSecurityGroupIds.isEmpty)
'VpcSecurityGroupIds': ''
else
for (var i1 = 0; i1 < vpcSecurityGroupIds.length; i1++)
'VpcSecurityGroupIds.VpcSecurityGroupId.${i1 + 1}':
vpcSecurityGroupIds[i1],
};
final $result = await _protocol.send(
$request,
action: 'CreateDBInstance',
version: '2014-10-31',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
resultWrapper: 'CreateDBInstanceResult',
);
return CreateDBInstanceResult.fromXml($result);
}