Class DatabaseInstanceBase

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.rds.DatabaseInstanceBase
All Implemented Interfaces:
IConstruct, IDependable, IResource, IConnectable, IDatabaseInstance, ISecretAttachmentTarget, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct
Direct Known Subclasses:
DatabaseInstance, DatabaseInstanceFromSnapshot, DatabaseInstanceReadReplica

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.121Z") @Stability(Stable) public abstract class DatabaseInstanceBase extends Resource implements IDatabaseInstance
A new or imported database instance.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ec2.*;
 import software.amazon.awscdk.services.rds.*;
 IInstanceEngine instanceEngine;
 SecurityGroup securityGroup;
 IDatabaseInstance databaseInstanceBase = DatabaseInstanceBase.fromDatabaseInstanceAttributes(this, "MyDatabaseInstanceBase", DatabaseInstanceAttributes.builder()
         .instanceEndpointAddress("instanceEndpointAddress")
         .instanceIdentifier("instanceIdentifier")
         .port(123)
         .securityGroups(List.of(securityGroup))
         // the properties below are optional
         .engine(instanceEngine)
         .build());
 
  • Constructor Details

    • DatabaseInstanceBase

      protected DatabaseInstanceBase(software.amazon.jsii.JsiiObjectRef objRef)
    • DatabaseInstanceBase

      protected DatabaseInstanceBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • DatabaseInstanceBase

      @Stability(Stable) protected DatabaseInstanceBase(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ResourceProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • DatabaseInstanceBase

      @Stability(Stable) protected DatabaseInstanceBase(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • fromDatabaseInstanceAttributes

      @Stability(Stable) @NotNull public static IDatabaseInstance fromDatabaseInstanceAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DatabaseInstanceAttributes attrs)
      Import an existing database instance.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • addProxy

      @Stability(Stable) @NotNull public DatabaseProxy addProxy(@NotNull String id, @NotNull DatabaseProxyOptions options)
      Add a new db proxy to this instance.

      Specified by:
      addProxy in interface IDatabaseInstance
      Parameters:
      id - This parameter is required.
      options - This parameter is required.
    • asSecretAttachmentTarget

      @Stability(Stable) @NotNull public SecretAttachmentTargetProps asSecretAttachmentTarget()
      Renders the secret attachment target specifications.
      Specified by:
      asSecretAttachmentTarget in interface ISecretAttachmentTarget
    • grantConnect

      @Stability(Stable) @NotNull public Grant grantConnect(@NotNull IGrantable grantee)
      Grant the given identity connection access to the database.

      Note: this method does not currently work, see https://github.com/aws/aws-cdk/issues/11851 for details.

      Specified by:
      grantConnect in interface IDatabaseInstance
      Parameters:
      grantee - This parameter is required.
      See Also:
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for this DBInstance.

      Specified by:
      metric in interface IDatabaseInstance
      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this DBInstance.

      Specified by:
      metric in interface IDatabaseInstance
      Parameters:
      metricName - This parameter is required.
    • metricCPUUtilization

      @Stability(Stable) @NotNull public Metric metricCPUUtilization(@Nullable MetricOptions props)
      The percentage of CPU utilization.

      Average over 5 minutes

      Specified by:
      metricCPUUtilization in interface IDatabaseInstance
      Parameters:
      props -
    • metricCPUUtilization

      @Stability(Stable) @NotNull public Metric metricCPUUtilization()
      The percentage of CPU utilization.

      Average over 5 minutes

      Specified by:
      metricCPUUtilization in interface IDatabaseInstance
    • metricDatabaseConnections

      @Stability(Stable) @NotNull public Metric metricDatabaseConnections(@Nullable MetricOptions props)
      The number of database connections in use.

      Average over 5 minutes

      Specified by:
      metricDatabaseConnections in interface IDatabaseInstance
      Parameters:
      props -
    • metricDatabaseConnections

      @Stability(Stable) @NotNull public Metric metricDatabaseConnections()
      The number of database connections in use.

      Average over 5 minutes

      Specified by:
      metricDatabaseConnections in interface IDatabaseInstance
    • metricFreeableMemory

      @Stability(Stable) @NotNull public Metric metricFreeableMemory(@Nullable MetricOptions props)
      The amount of available random access memory.

      Average over 5 minutes

      Specified by:
      metricFreeableMemory in interface IDatabaseInstance
      Parameters:
      props -
    • metricFreeableMemory

      @Stability(Stable) @NotNull public Metric metricFreeableMemory()
      The amount of available random access memory.

      Average over 5 minutes

      Specified by:
      metricFreeableMemory in interface IDatabaseInstance
    • metricFreeStorageSpace

      @Stability(Stable) @NotNull public Metric metricFreeStorageSpace(@Nullable MetricOptions props)
      The amount of available storage space.

      Average over 5 minutes

      Specified by:
      metricFreeStorageSpace in interface IDatabaseInstance
      Parameters:
      props -
    • metricFreeStorageSpace

      @Stability(Stable) @NotNull public Metric metricFreeStorageSpace()
      The amount of available storage space.

      Average over 5 minutes

      Specified by:
      metricFreeStorageSpace in interface IDatabaseInstance
    • metricReadIOPS

      @Stability(Stable) @NotNull public Metric metricReadIOPS(@Nullable MetricOptions props)
      The average number of disk write I/O operations per second.

      Average over 5 minutes

      Specified by:
      metricReadIOPS in interface IDatabaseInstance
      Parameters:
      props -
    • metricReadIOPS

      @Stability(Stable) @NotNull public Metric metricReadIOPS()
      The average number of disk write I/O operations per second.

      Average over 5 minutes

      Specified by:
      metricReadIOPS in interface IDatabaseInstance
    • metricWriteIOPS

      @Stability(Stable) @NotNull public Metric metricWriteIOPS(@Nullable MetricOptions props)
      The average number of disk read I/O operations per second.

      Average over 5 minutes

      Specified by:
      metricWriteIOPS in interface IDatabaseInstance
      Parameters:
      props -
    • metricWriteIOPS

      @Stability(Stable) @NotNull public Metric metricWriteIOPS()
      The average number of disk read I/O operations per second.

      Average over 5 minutes

      Specified by:
      metricWriteIOPS in interface IDatabaseInstance
    • onEvent

      @Stability(Stable) @NotNull public Rule onEvent(@NotNull String id, @Nullable OnEventOptions options)
      Defines a CloudWatch event rule which triggers for instance events.

      Use rule.addEventPattern(pattern) to specify a filter.

      Specified by:
      onEvent in interface IDatabaseInstance
      Parameters:
      id - This parameter is required.
      options -
    • onEvent

      @Stability(Stable) @NotNull public Rule onEvent(@NotNull String id)
      Defines a CloudWatch event rule which triggers for instance events.

      Use rule.addEventPattern(pattern) to specify a filter.

      Specified by:
      onEvent in interface IDatabaseInstance
      Parameters:
      id - This parameter is required.
    • getConnections

      @Stability(Stable) @NotNull public abstract Connections getConnections()
      Access to network connections.
      Specified by:
      getConnections in interface IConnectable
    • getDbInstanceEndpointAddress

      @Stability(Stable) @NotNull public abstract String getDbInstanceEndpointAddress()
      The instance endpoint address.
      Specified by:
      getDbInstanceEndpointAddress in interface IDatabaseInstance
    • getDbInstanceEndpointPort

      @Stability(Stable) @NotNull public abstract String getDbInstanceEndpointPort()
      The instance endpoint port.
      Specified by:
      getDbInstanceEndpointPort in interface IDatabaseInstance
    • getInstanceArn

      @Stability(Stable) @NotNull public String getInstanceArn()
      The instance arn.
      Specified by:
      getInstanceArn in interface IDatabaseInstance
    • getInstanceEndpoint

      @Stability(Stable) @NotNull public abstract Endpoint getInstanceEndpoint()
      The instance endpoint.
      Specified by:
      getInstanceEndpoint in interface IDatabaseInstance
    • getInstanceIdentifier

      @Stability(Stable) @NotNull public abstract String getInstanceIdentifier()
      The instance identifier.
      Specified by:
      getInstanceIdentifier in interface IDatabaseInstance
    • getEngine

      @Stability(Stable) @Nullable public abstract IInstanceEngine getEngine()
      The engine of this database Instance.

      May be not known for imported Instances if it wasn't provided explicitly, or for read replicas.

      Specified by:
      getEngine in interface IDatabaseInstance
    • getEnableIamAuthentication

      @Stability(Stable) @Nullable protected abstract Boolean getEnableIamAuthentication()
    • setEnableIamAuthentication

      @Stability(Stable) protected abstract void setEnableIamAuthentication(@Nullable Boolean value)