Class DatabaseInstanceBase

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

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:50.038Z") @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)
         .instanceResourceId("instanceResourceId")
         .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, @Nullable String dbUser)
      Grant the given identity connection access to the database.

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

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

      Specified by:
      grantConnect in interface IDatabaseInstance
      Parameters:
      grantee - This parameter is required.
    • 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
    • getInstanceResourceId

      @Stability(Stable) @Nullable public abstract String getInstanceResourceId()
      The AWS Region-unique, immutable identifier for the DB instance.

      This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB instance is accessed.

      Specified by:
      getInstanceResourceId in interface IDatabaseInstance
      See Also:
    • getEnableIamAuthentication

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

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