Class CfnDBInstance

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:41.897Z") @Stability(Stable) public class CfnDBInstance extends CfnResource implements IInspectable
A CloudFormation AWS::DocDB::DBInstance.

The AWS::DocDB::DBInstance Amazon DocumentDB (with MongoDB compatibility) resource describes a DBInstance. For more information, see DBInstance in the Amazon DocumentDB Developer Guide .

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.docdb.*;
 CfnDBInstance cfnDBInstance = CfnDBInstance.Builder.create(this, "MyCfnDBInstance")
         .dbClusterIdentifier("dbClusterIdentifier")
         .dbInstanceClass("dbInstanceClass")
         // the properties below are optional
         .autoMinorVersionUpgrade(false)
         .availabilityZone("availabilityZone")
         .dbInstanceIdentifier("dbInstanceIdentifier")
         .enablePerformanceInsights(false)
         .preferredMaintenanceWindow("preferredMaintenanceWindow")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnDBInstance

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

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

      @Stability(Stable) public CfnDBInstance(@NotNull Construct scope, @NotNull String id, @NotNull CfnDBInstanceProps props)
      Create a new AWS::DocDB::DBInstance.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrEndpoint

      @Stability(Stable) @NotNull public String getAttrEndpoint()
      The connection endpoint for the instance.

      For example: sample-cluster.cluster-abcdefghijkl.us-east-1.docdb.amazonaws.com .

    • getAttrPort

      @Stability(Stable) @NotNull public String getAttrPort()
      The port number on which the database accepts connections, such as 27017 .
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      The tags to be assigned to the instance.

      You can assign up to 10 tags to an instance.

    • getDbClusterIdentifier

      @Stability(Stable) @NotNull public String getDbClusterIdentifier()
      The identifier of the cluster that the instance will belong to.
    • setDbClusterIdentifier

      @Stability(Stable) public void setDbClusterIdentifier(@NotNull String value)
      The identifier of the cluster that the instance will belong to.
    • getDbInstanceClass

      @Stability(Stable) @NotNull public String getDbInstanceClass()
      The compute and memory capacity of the instance;

      for example, db.m4.large . If you change the class of an instance there can be some interruption in the cluster's service.

    • setDbInstanceClass

      @Stability(Stable) public void setDbInstanceClass(@NotNull String value)
      The compute and memory capacity of the instance;

      for example, db.m4.large . If you change the class of an instance there can be some interruption in the cluster's service.

    • getAutoMinorVersionUpgrade

      @Stability(Stable) @Nullable public Object getAutoMinorVersionUpgrade()
      This parameter does not apply to Amazon DocumentDB.

      Amazon DocumentDB does not perform minor version upgrades regardless of the value set.

      Default: false

    • setAutoMinorVersionUpgrade

      @Stability(Stable) public void setAutoMinorVersionUpgrade(@Nullable Boolean value)
      This parameter does not apply to Amazon DocumentDB.

      Amazon DocumentDB does not perform minor version upgrades regardless of the value set.

      Default: false

    • setAutoMinorVersionUpgrade

      @Stability(Stable) public void setAutoMinorVersionUpgrade(@Nullable IResolvable value)
      This parameter does not apply to Amazon DocumentDB.

      Amazon DocumentDB does not perform minor version upgrades regardless of the value set.

      Default: false

    • getAvailabilityZone

      @Stability(Stable) @Nullable public String getAvailabilityZone()
      The Amazon EC2 Availability Zone that the instance is created in.

      Default: A random, system-chosen Availability Zone in the endpoint's AWS Region .

      Example: us-east-1d

    • setAvailabilityZone

      @Stability(Stable) public void setAvailabilityZone(@Nullable String value)
      The Amazon EC2 Availability Zone that the instance is created in.

      Default: A random, system-chosen Availability Zone in the endpoint's AWS Region .

      Example: us-east-1d

    • getDbInstanceIdentifier

      @Stability(Stable) @Nullable public String getDbInstanceIdentifier()
      The instance identifier. This parameter is stored as a lowercase string.

      Constraints:

      • Must contain from 1 to 63 letters, numbers, or hyphens.
      • The first character must be a letter.
      • Cannot end with a hyphen or contain two consecutive hyphens.

      Example: mydbinstance

    • setDbInstanceIdentifier

      @Stability(Stable) public void setDbInstanceIdentifier(@Nullable String value)
      The instance identifier. This parameter is stored as a lowercase string.

      Constraints:

      • Must contain from 1 to 63 letters, numbers, or hyphens.
      • The first character must be a letter.
      • Cannot end with a hyphen or contain two consecutive hyphens.

      Example: mydbinstance

    • getEnablePerformanceInsights

      @Stability(Stable) @Nullable public Object getEnablePerformanceInsights()
      AWS::DocDB::DBInstance.EnablePerformanceInsights.
    • setEnablePerformanceInsights

      @Stability(Stable) public void setEnablePerformanceInsights(@Nullable Boolean value)
      AWS::DocDB::DBInstance.EnablePerformanceInsights.
    • setEnablePerformanceInsights

      @Stability(Stable) public void setEnablePerformanceInsights(@Nullable IResolvable value)
      AWS::DocDB::DBInstance.EnablePerformanceInsights.
    • getPreferredMaintenanceWindow

      @Stability(Stable) @Nullable public String getPreferredMaintenanceWindow()
      The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC).

      Format: ddd:hh24:mi-ddd:hh24:mi

      The default is 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.

      Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun

      Constraints: Minimum 30-minute window.

    • setPreferredMaintenanceWindow

      @Stability(Stable) public void setPreferredMaintenanceWindow(@Nullable String value)
      The time range each week during which system maintenance can occur, in Universal Coordinated Time (UTC).

      Format: ddd:hh24:mi-ddd:hh24:mi

      The default is 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.

      Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun

      Constraints: Minimum 30-minute window.