Class InstanceProps
Instance properties for database instances.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.AWS.RDS.dll
Syntax (csharp)
public class InstanceProps : Object, IInstanceProps
Syntax (vb)
Public Class InstanceProps
Inherits Object
Implements IInstanceProps
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
var cluster = new DatabaseCluster(this, "Database", new DatabaseClusterProps {
Engine = DatabaseClusterEngine.AURORA,
InstanceProps = new InstanceProps { Vpc = vpc }
});
var proxy = new DatabaseProxy(this, "Proxy", new DatabaseProxyProps {
ProxyTarget = ProxyTarget.FromCluster(cluster),
Secrets = new [] { cluster.Secret },
Vpc = vpc
});
var role = new Role(this, "DBProxyRole", new RoleProps { AssumedBy = new AccountPrincipal(Account) });
proxy.GrantConnect(role, "admin");
Synopsis
Constructors
InstanceProps() |
Properties
AllowMajorVersionUpgrade | Whether to allow upgrade of major version for the DB instance. |
AutoMinorVersionUpgrade | Whether to enable automatic upgrade of minor version for the DB instance. |
DeleteAutomatedBackups | Whether to remove automated backups immediately after the DB instance is deleted for the DB instance. |
EnablePerformanceInsights | Whether to enable Performance Insights for the DB instance. |
InstanceType | What type of instance to start for the replicas. |
ParameterGroup | The DB parameter group to associate with the instance. |
Parameters | The parameters in the DBParameterGroup to create automatically. |
PerformanceInsightEncryptionKey | The AWS KMS key for encryption of Performance Insights data. |
PerformanceInsightRetention | The amount of time, in days, to retain Performance Insights data. |
PubliclyAccessible | Indicates whether the DB instance is an internet-facing instance. |
SecurityGroups | Security group. |
Vpc | What subnets to run the RDS instances in. |
VpcSubnets | Where to place the instances within the VPC. |
Constructors
InstanceProps()
public InstanceProps()
Properties
AllowMajorVersionUpgrade
Whether to allow upgrade of major version for the DB instance.
public Nullable<bool> AllowMajorVersionUpgrade { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false
AutoMinorVersionUpgrade
Whether to enable automatic upgrade of minor version for the DB instance.
public Nullable<bool> AutoMinorVersionUpgrade { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true
DeleteAutomatedBackups
Whether to remove automated backups immediately after the DB instance is deleted for the DB instance.
public Nullable<bool> DeleteAutomatedBackups { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true
EnablePerformanceInsights
Whether to enable Performance Insights for the DB instance.
public Nullable<bool> EnablePerformanceInsights { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - false, unless performanceInsightRentention
or performanceInsightEncryptionKey
is set.
InstanceType
What type of instance to start for the replicas.
public InstanceType InstanceType { get; set; }
Property Value
Remarks
Default: - t3.medium (or, more precisely, db.t3.medium)
ParameterGroup
The DB parameter group to associate with the instance.
public IParameterGroup ParameterGroup { get; set; }
Property Value
Remarks
Default: no parameter group
Parameters
The parameters in the DBParameterGroup to create automatically.
public IDictionary<string, string> Parameters { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBParameterGroup.
Default: - None
PerformanceInsightEncryptionKey
The AWS KMS key for encryption of Performance Insights data.
public IKey PerformanceInsightEncryptionKey { get; set; }
Property Value
Remarks
Default: - default master key
PerformanceInsightRetention
The amount of time, in days, to retain Performance Insights data.
public Nullable<PerformanceInsightRetention> PerformanceInsightRetention { get; set; }
Property Value
System.Nullable<PerformanceInsightRetention>
Remarks
Default: 7
PubliclyAccessible
Indicates whether the DB instance is an internet-facing instance.
public Nullable<bool> PubliclyAccessible { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - true
if vpcSubnets
is subnetType: SubnetType.PUBLIC
, false
otherwise
SecurityGroups
Security group.
public ISecurityGroup[] SecurityGroups { get; set; }
Property Value
Remarks
Default: a new security group is created.
Vpc
What subnets to run the RDS instances in.
public IVpc Vpc { get; set; }
Property Value
Remarks
Must be at least 2 subnets in two different AZs.
VpcSubnets
Where to place the instances within the VPC.
public ISubnetSelection VpcSubnets { get; set; }
Property Value
Remarks
Default: - the Vpc default strategy if not specified.