Class DatabaseInstanceBase
A new or imported database instance.
Inheritance
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.AWS.RDS.dll
Syntax (csharp)
public abstract class DatabaseInstanceBase : Resource, IDatabaseInstance, IResource, IConstruct, IDependable, IConnectable, ISecretAttachmentTarget
Syntax (vb)
Public MustInherit Class DatabaseInstanceBase
Inherits Resource
Implements IDatabaseInstance, IResource, IConstruct, IDependable, IConnectable, ISecretAttachmentTarget
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.AWS.EC2;
using Amazon.CDK.AWS.RDS;
IInstanceEngine instanceEngine;
SecurityGroup securityGroup;
var databaseInstanceBase = DatabaseInstanceBase.FromDatabaseInstanceAttributes(this, "MyDatabaseInstanceBase", new DatabaseInstanceAttributes {
InstanceEndpointAddress = "instanceEndpointAddress",
InstanceIdentifier = "instanceIdentifier",
Port = 123,
SecurityGroups = new [] { securityGroup },
// the properties below are optional
Engine = instanceEngine
});
Synopsis
Constructors
DatabaseInstanceBase(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
DatabaseInstanceBase(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
DatabaseInstanceBase(Construct, String, IResourceProps) |
Properties
Connections | Access to network connections. |
DbInstanceEndpointAddress | The instance endpoint address. |
DbInstanceEndpointPort | The instance endpoint port. |
EnableIamAuthentication | |
Engine | The engine of this database Instance. |
InstanceArn | The instance arn. |
InstanceEndpoint | The instance endpoint. |
InstanceIdentifier | The instance identifier. |
Methods
AddProxy(String, IDatabaseProxyOptions) | Add a new db proxy to this instance. |
AsSecretAttachmentTarget() | Renders the secret attachment target specifications. |
FromDatabaseInstanceAttributes(Construct, String, IDatabaseInstanceAttributes) | Import an existing database instance. |
GrantConnect(IGrantable) | Grant the given identity connection access to the database. |
Metric(String, IMetricOptions) | Return the given named metric for this DBInstance. |
MetricCPUUtilization(IMetricOptions) | The percentage of CPU utilization. |
MetricDatabaseConnections(IMetricOptions) | The number of database connections in use. |
MetricFreeableMemory(IMetricOptions) | The amount of available random access memory. |
MetricFreeStorageSpace(IMetricOptions) | The amount of available storage space. |
MetricReadIOPS(IMetricOptions) | The average number of disk write I/O operations per second. |
MetricWriteIOPS(IMetricOptions) | The average number of disk read I/O operations per second. |
OnEvent(String, IOnEventOptions) | Defines a CloudWatch event rule which triggers for instance events. |
Constructors
DatabaseInstanceBase(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected DatabaseInstanceBase(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
DatabaseInstanceBase(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected DatabaseInstanceBase(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
DatabaseInstanceBase(Construct, String, IResourceProps)
protected DatabaseInstanceBase(Construct scope, string id, IResourceProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IResourceProps
Properties
Connections
Access to network connections.
public abstract Connections_ Connections { get; }
Property Value
DbInstanceEndpointAddress
The instance endpoint address.
public abstract string DbInstanceEndpointAddress { get; }
Property Value
System.String
DbInstanceEndpointPort
The instance endpoint port.
public abstract string DbInstanceEndpointPort { get; }
Property Value
System.String
EnableIamAuthentication
protected abstract Nullable<bool> EnableIamAuthentication { get; set; }
Property Value
System.Nullable<System.Boolean>
Engine
The engine of this database Instance.
public abstract IInstanceEngine Engine { get; }
Property Value
Remarks
May be not known for imported Instances if it wasn't provided explicitly, or for read replicas.
InstanceArn
The instance arn.
public virtual string InstanceArn { get; }
Property Value
System.String
InstanceEndpoint
InstanceIdentifier
The instance identifier.
public abstract string InstanceIdentifier { get; }
Property Value
System.String
Methods
AddProxy(String, IDatabaseProxyOptions)
Add a new db proxy to this instance.
public virtual DatabaseProxy AddProxy(string id, IDatabaseProxyOptions options)
Parameters
- id System.String
- options IDatabaseProxyOptions
Returns
AsSecretAttachmentTarget()
Renders the secret attachment target specifications.
public virtual ISecretAttachmentTargetProps AsSecretAttachmentTarget()
Returns
FromDatabaseInstanceAttributes(Construct, String, IDatabaseInstanceAttributes)
Import an existing database instance.
public static IDatabaseInstance FromDatabaseInstanceAttributes(Construct scope, string id, IDatabaseInstanceAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IDatabaseInstanceAttributes
Returns
GrantConnect(IGrantable)
Grant the given identity connection access to the database.
public virtual Grant GrantConnect(IGrantable grantee)
Parameters
- grantee IGrantable
Returns
Remarks
Note: this method does not currently work, see https://github.com/aws/aws-cdk/issues/11851 for details.
Metric(String, IMetricOptions)
Return the given named metric for this DBInstance.
public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
- metricName System.String
- props IMetricOptions
Returns
MetricCPUUtilization(IMetricOptions)
The percentage of CPU utilization.
public virtual Metric MetricCPUUtilization(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Average over 5 minutes
MetricDatabaseConnections(IMetricOptions)
The number of database connections in use.
public virtual Metric MetricDatabaseConnections(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Average over 5 minutes
MetricFreeableMemory(IMetricOptions)
The amount of available random access memory.
public virtual Metric MetricFreeableMemory(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Average over 5 minutes
MetricFreeStorageSpace(IMetricOptions)
The amount of available storage space.
public virtual Metric MetricFreeStorageSpace(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Average over 5 minutes
MetricReadIOPS(IMetricOptions)
The average number of disk write I/O operations per second.
public virtual Metric MetricReadIOPS(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Average over 5 minutes
MetricWriteIOPS(IMetricOptions)
The average number of disk read I/O operations per second.
public virtual Metric MetricWriteIOPS(IMetricOptions props = null)
Parameters
- props IMetricOptions
Returns
Remarks
Average over 5 minutes
OnEvent(String, IOnEventOptions)
Defines a CloudWatch event rule which triggers for instance events.
public virtual Rule OnEvent(string id, IOnEventOptions options = null)
Parameters
- id System.String
- options IOnEventOptions
Returns
Remarks
Use
rule.addEventPattern(pattern)
to specify a filter.