Interface IDatabaseInstanceNewProps
Construction properties for a DatabaseInstanceNew.
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IDatabaseInstanceNewProps
Syntax (vb)
Public Interface IDatabaseInstanceNewProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.KMS;
using Amazon.CDK.AWS.Logs;
using Amazon.CDK.AWS.RDS;
using Amazon.CDK.AWS.S3;
Bucket bucket;
CaCertificate caCertificate;
Key key;
OptionGroup optionGroup;
ParameterGroup parameterGroup;
Role role;
SecurityGroup securityGroup;
Subnet subnet;
SubnetFilter subnetFilter;
SubnetGroup subnetGroup;
Vpc vpc;
var databaseInstanceNewProps = new DatabaseInstanceNewProps {
Vpc = vpc,
// the properties below are optional
AutoMinorVersionUpgrade = false,
AvailabilityZone = "availabilityZone",
BackupRetention = Duration.Minutes(30),
CaCertificate = caCertificate,
CloudwatchLogsExports = new [] { "cloudwatchLogsExports" },
CloudwatchLogsRetention = RetentionDays.ONE_DAY,
CloudwatchLogsRetentionRole = role,
CopyTagsToSnapshot = false,
DeleteAutomatedBackups = false,
DeletionProtection = false,
Domain = "domain",
DomainRole = role,
EnablePerformanceInsights = false,
IamAuthentication = false,
InstanceIdentifier = "instanceIdentifier",
Iops = 123,
MaxAllocatedStorage = 123,
MonitoringInterval = Duration.Minutes(30),
MonitoringRole = role,
MultiAz = false,
NetworkType = NetworkType.IPV4,
OptionGroup = optionGroup,
ParameterGroup = parameterGroup,
PerformanceInsightEncryptionKey = key,
PerformanceInsightRetention = PerformanceInsightRetention.DEFAULT,
Port = 123,
PreferredBackupWindow = "preferredBackupWindow",
PreferredMaintenanceWindow = "preferredMaintenanceWindow",
ProcessorFeatures = new ProcessorFeatures {
CoreCount = 123,
ThreadsPerCore = 123
},
PubliclyAccessible = false,
RemovalPolicy = RemovalPolicy.DESTROY,
S3ExportBuckets = new [] { bucket },
S3ExportRole = role,
S3ImportBuckets = new [] { bucket },
S3ImportRole = role,
SecurityGroups = new [] { securityGroup },
StorageThroughput = 123,
StorageType = StorageType.STANDARD,
SubnetGroup = subnetGroup,
VpcSubnets = new SubnetSelection {
AvailabilityZones = new [] { "availabilityZones" },
OnePerAz = false,
SubnetFilters = new [] { subnetFilter },
SubnetGroupName = "subnetGroupName",
Subnets = new [] { subnet },
SubnetType = SubnetType.PRIVATE_ISOLATED
}
};
Synopsis
Properties
AutoMinorVersionUpgrade | Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window. |
AvailabilityZone | The name of the Availability Zone where the DB instance will be located. |
BackupRetention | The number of days during which automatic DB snapshots are retained. |
CaCertificate | The identifier of the CA certificate for this DB instance. |
CloudwatchLogsExports | The list of log types that need to be enabled for exporting to CloudWatch Logs. |
CloudwatchLogsRetention | The number of days log events are kept in CloudWatch Logs. |
CloudwatchLogsRetentionRole | The IAM role for the Lambda function associated with the custom resource that sets the retention policy. |
CopyTagsToSnapshot | Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. |
DeleteAutomatedBackups | Indicates whether automated backups should be deleted or retained when you delete a DB instance. |
DeletionProtection | Indicates whether the DB instance should have deletion protection enabled. |
Domain | The Active Directory directory ID to create the DB instance in. |
DomainRole | The IAM role to be used when making API calls to the Directory Service. |
EnablePerformanceInsights | Whether to enable Performance Insights for the DB instance. |
IamAuthentication | Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. |
InstanceIdentifier | A name for the DB instance. |
Iops | The number of I/O operations per second (IOPS) that the database provisions. |
MaxAllocatedStorage | Upper limit to which RDS can scale the storage in GiB(Gibibyte). |
MonitoringInterval | The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance. |
MonitoringRole | Role that will be used to manage DB instance monitoring. |
MultiAz | Specifies if the database instance is a multiple Availability Zone deployment. |
NetworkType | The network type of the DB instance. |
OptionGroup | The option group to associate with the instance. |
ParameterGroup | The DB parameter group to associate with the instance. |
PerformanceInsightEncryptionKey | The AWS KMS key for encryption of Performance Insights data. |
PerformanceInsightRetention | The amount of time, in days, to retain Performance Insights data. |
Port | The port for the instance. |
PreferredBackupWindow | The daily time range during which automated backups are performed. |
PreferredMaintenanceWindow | The weekly time range (in UTC) during which system maintenance can occur. |
ProcessorFeatures | The number of CPU cores and the number of threads per core. |
PubliclyAccessible | Indicates whether the DB instance is an internet-facing instance. |
RemovalPolicy | The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update. |
S3ExportBuckets | S3 buckets that you want to load data into. |
S3ExportRole | Role that will be associated with this DB instance to enable S3 export. |
S3ImportBuckets | S3 buckets that you want to load data from. |
S3ImportRole | Role that will be associated with this DB instance to enable S3 import. |
SecurityGroups | The security groups to assign to the DB instance. |
StorageThroughput | The storage throughput, specified in mebibytes per second (MiBps). |
StorageType | The storage type. |
SubnetGroup | Existing subnet group for the instance. |
Vpc | The VPC network where the DB subnet group should be created. |
VpcSubnets | The type of subnets to add to the created DB subnet group. |
Properties
AutoMinorVersionUpgrade
Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.
virtual Nullable<bool> AutoMinorVersionUpgrade { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
AvailabilityZone
The name of the Availability Zone where the DB instance will be located.
virtual string AvailabilityZone { get; }
Property Value
System.String
Remarks
Default: - no preference
BackupRetention
The number of days during which automatic DB snapshots are retained.
virtual Duration BackupRetention { get; }
Property Value
Remarks
Set to zero to disable backups. When creating a read replica, you must enable automatic backups on the source database instance by setting the backup retention to a value other than zero.
Default: - Duration.days(1) for source instances, disabled for read replicas
CaCertificate
The identifier of the CA certificate for this DB instance.
virtual CaCertificate CaCertificate { get; }
Property Value
Remarks
Specifying or updating this property triggers a reboot.
For RDS DB engines:
Default: - RDS will choose a certificate authority
CloudwatchLogsExports
The list of log types that need to be enabled for exporting to CloudWatch Logs.
virtual string[] CloudwatchLogsExports { get; }
Property Value
System.String[]
Remarks
Default: - no log exports
CloudwatchLogsRetention
The number of days log events are kept in CloudWatch Logs.
virtual Nullable<RetentionDays> CloudwatchLogsRetention { get; }
Property Value
System.Nullable<RetentionDays>
Remarks
When updating
this property, unsetting it doesn't remove the log retention policy. To
remove the retention policy, set the value to Infinity
.
Default: - logs never expire
CloudwatchLogsRetentionRole
The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
virtual IRole CloudwatchLogsRetentionRole { get; }
Property Value
Remarks
Default: - a new role is created.
CopyTagsToSnapshot
Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance.
virtual Nullable<bool> CopyTagsToSnapshot { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
DeleteAutomatedBackups
Indicates whether automated backups should be deleted or retained when you delete a DB instance.
virtual Nullable<bool> DeleteAutomatedBackups { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
DeletionProtection
Indicates whether the DB instance should have deletion protection enabled.
virtual Nullable<bool> DeletionProtection { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true if removalPolicy
is RETAIN, false otherwise
Domain
The Active Directory directory ID to create the DB instance in.
virtual string Domain { get; }
Property Value
System.String
Remarks
Default: - Do not join domain
DomainRole
The IAM role to be used when making API calls to the Directory Service.
virtual IRole DomainRole { get; }
Property Value
Remarks
The role needs the AWS-managed policy AmazonRDSDirectoryServiceAccess or equivalent.
Default: - The role will be created for you if DatabaseInstanceNewProps#domain
is specified
EnablePerformanceInsights
Whether to enable Performance Insights for the DB instance.
virtual Nullable<bool> EnablePerformanceInsights { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false, unless performanceInsightRetention
or performanceInsightEncryptionKey
is set.
IamAuthentication
Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.
virtual Nullable<bool> IamAuthentication { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
InstanceIdentifier
A name for the DB instance.
virtual string InstanceIdentifier { get; }
Property Value
System.String
Remarks
If you specify a name, AWS CloudFormation converts it to lowercase.
Default: - a CloudFormation generated name
Iops
The number of I/O operations per second (IOPS) that the database provisions.
virtual Nullable<double> Iops { get; }
Property Value
System.Nullable<System.Double>
Remarks
The value must be equal to or greater than 1000.
Default: - no provisioned iops if storage type is not specified. For GP3: 3,000 IOPS if allocated storage is less than 400 GiB for MariaDB, MySQL, and PostgreSQL, less than 200 GiB for Oracle and less than 20 GiB for SQL Server. 12,000 IOPS otherwise (except for SQL Server where the default is always 3,000 IOPS).
MaxAllocatedStorage
Upper limit to which RDS can scale the storage in GiB(Gibibyte).
virtual Nullable<double> MaxAllocatedStorage { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: - No autoscaling of RDS instance
MonitoringInterval
The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance.
virtual Duration MonitoringInterval { get; }
Property Value
Remarks
Default: - no enhanced monitoring
MonitoringRole
Role that will be used to manage DB instance monitoring.
virtual IRole MonitoringRole { get; }
Property Value
Remarks
Default: - A role is automatically created for you
MultiAz
Specifies if the database instance is a multiple Availability Zone deployment.
virtual Nullable<bool> MultiAz { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
NetworkType
The network type of the DB instance.
virtual Nullable<NetworkType> NetworkType { get; }
Property Value
System.Nullable<NetworkType>
Remarks
Default: - IPV4
OptionGroup
The option group to associate with the instance.
virtual IOptionGroup OptionGroup { get; }
Property Value
Remarks
Default: - no option group
ParameterGroup
The DB parameter group to associate with the instance.
virtual IParameterGroup ParameterGroup { get; }
Property Value
Remarks
Default: - no parameter group
PerformanceInsightEncryptionKey
The AWS KMS key for encryption of Performance Insights data.
virtual IKey PerformanceInsightEncryptionKey { get; }
Property Value
Remarks
Default: - default master key
PerformanceInsightRetention
The amount of time, in days, to retain Performance Insights data.
virtual Nullable<PerformanceInsightRetention> PerformanceInsightRetention { get; }
Property Value
System.Nullable<PerformanceInsightRetention>
Remarks
Default: 7 this is the free tier
Port
The port for the instance.
virtual Nullable<double> Port { get; }
Property Value
System.Nullable<System.Double>
Remarks
Default: - the default port for the chosen engine.
PreferredBackupWindow
The daily time range during which automated backups are performed.
virtual string PreferredBackupWindow { get; }
Property Value
System.String
Remarks
Constraints:
Default: - 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 https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow
PreferredMaintenanceWindow
The weekly time range (in UTC) during which system maintenance can occur.
virtual string PreferredMaintenanceWindow { get; }
Property Value
System.String
Remarks
Format: ddd:hh24:mi-ddd:hh24:mi
Constraint: Minimum 30-minute window
Default: - 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 https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance
ProcessorFeatures
The number of CPU cores and the number of threads per core.
virtual IProcessorFeatures ProcessorFeatures { get; }
Property Value
Remarks
Default: - the default number of CPU cores and threads per core for the chosen instance class.
PubliclyAccessible
Indicates whether the DB instance is an internet-facing instance.
virtual Nullable<bool> PubliclyAccessible { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
If not specified, the instance's vpcSubnets will be used to determine if the instance is internet-facing or not.
Default: - true
if the instance's vpcSubnets
is subnetType: SubnetType.PUBLIC
, false
otherwise
RemovalPolicy
The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.
virtual Nullable<RemovalPolicy> RemovalPolicy { get; }
Property Value
System.Nullable<RemovalPolicy>
Remarks
Default: - RemovalPolicy.SNAPSHOT (remove the resource, but retain a snapshot of the data)
S3ExportBuckets
S3 buckets that you want to load data into.
virtual IBucket[] S3ExportBuckets { get; }
Property Value
IBucket[]
Remarks
This property must not be used if s3ExportRole
is used.
For Microsoft SQL Server:
Default: - None
See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.html
S3ExportRole
Role that will be associated with this DB instance to enable S3 export.
virtual IRole S3ExportRole { get; }
Property Value
Remarks
This property must not be used if s3ExportBuckets
is used.
For Microsoft SQL Server:
Default: - New role is created if s3ExportBuckets
is set, no role is defined otherwise
See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.html
S3ImportBuckets
S3 buckets that you want to load data from.
virtual IBucket[] S3ImportBuckets { get; }
Property Value
IBucket[]
Remarks
This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.
This property must not be used if s3ImportRole
is used.
For Microsoft SQL Server:
Default: - None
See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Procedural.Importing.html
S3ImportRole
Role that will be associated with this DB instance to enable S3 import.
virtual IRole S3ImportRole { get; }
Property Value
Remarks
This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.
This property must not be used if s3ImportBuckets
is used.
For Microsoft SQL Server:
Default: - New role is created if s3ImportBuckets
is set, no role is defined otherwise
See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Procedural.Importing.html
SecurityGroups
The security groups to assign to the DB instance.
virtual ISecurityGroup[] SecurityGroups { get; }
Property Value
Remarks
Default: - a new security group is created
StorageThroughput
The storage throughput, specified in mebibytes per second (MiBps).
virtual Nullable<double> StorageThroughput { get; }
Property Value
System.Nullable<System.Double>
Remarks
Only applicable for GP3.
Default: - 125 MiBps if allocated storage is less than 400 GiB for MariaDB, MySQL, and PostgreSQL, less than 200 GiB for Oracle and less than 20 GiB for SQL Server. 500 MiBps otherwise (except for SQL Server where the default is always 125 MiBps).
See: https://docs.aws.amazon.com//AmazonRDS/latest/UserGuide/CHAP_Storage.html#gp3-storage
StorageType
The storage type.
virtual Nullable<StorageType> StorageType { get; }
Property Value
System.Nullable<StorageType>
Remarks
Storage types supported are gp2, io1, standard.
Default: GP2
See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#Concepts.Storage.GeneralSSD
SubnetGroup
Existing subnet group for the instance.
virtual ISubnetGroup SubnetGroup { get; }
Property Value
Remarks
Default: - a new subnet group will be created.
Vpc
VpcSubnets
The type of subnets to add to the created DB subnet group.
virtual ISubnetSelection VpcSubnets { get; }
Property Value
Remarks
Default: - private subnets