Class CfnDBInstancePropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.neptune.CfnDBInstancePropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:20:01.776Z") @Stability(Stable) public class CfnDBInstancePropsMixin extends Mixin implements software.constructs.IMixin
The AWS::Neptune::DBInstance type creates an Amazon Neptune DB instance.

Updating DB Instances

You can set a deletion policy for your DB instance to control how CloudFormation handles the instance when the stack is deleted. For Neptune DB instances, you can choose to retain the instance, to delete the instance, or to create a snapshot of the instance. The default CloudFormation behavior depends on the DBClusterIdentifier property:

  • For AWS::Neptune::DBInstance resources that don't specify the DBClusterIdentifier property, CloudFormation saves a snapshot of the DB instance.
  • For AWS::Neptune::DBInstance resources that do specify the DBClusterIdentifier property, CloudFormation deletes the DB instance.

Deleting DB Instances

If a DB instance is deleted or replaced during an update, CloudFormation deletes all automated snapshots. However, it retains manual DB snapshots. During an update that requires replacement, you can apply a stack policy to prevent DB instances from being replaced.

When properties labeled Update requires: Replacement are updated, CloudFormation first creates a replacement DB instance, changes references from other dependent resources to point to the replacement DB instance, and finally deletes the old DB instance.

We highly recommend that you take a snapshot of the database before updating the stack. If you don't, you lose the data when CloudFormation replaces your DB instance. To preserve your data, perform the following procedure:

  • Deactivate any applications that are using the DB instance so that there's no activity on the DB instance.
  • Create a snapshot of the DB instance.
  • If you want to restore your instance using a DB snapshot, modify the updated template with your DB instance changes and add the DBSnapshotIdentifier property with the ID of the DB snapshot that you want to use.
  • Update the stack.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cfnpropertymixins.services.neptune.*;
 import software.amazon.awscdk.*;
 IMergeStrategy mergeStrategy;
 CfnDBInstancePropsMixin cfnDBInstancePropsMixin = CfnDBInstancePropsMixin.Builder.create(CfnDBInstanceMixinProps.builder()
         .allowMajorVersionUpgrade(false)
         .autoMinorVersionUpgrade(false)
         .availabilityZone("availabilityZone")
         .dbClusterIdentifier("dbClusterIdentifier")
         .dbInstanceClass("dbInstanceClass")
         .dbInstanceIdentifier("dbInstanceIdentifier")
         .dbParameterGroupName("dbParameterGroupName")
         .dbSnapshotIdentifier("dbSnapshotIdentifier")
         .dbSubnetGroupName("dbSubnetGroupName")
         .preferredMaintenanceWindow("preferredMaintenanceWindow")
         .publiclyAccessible(false)
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnDBInstancePropsMixin

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

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

      @Stability(Stable) public CfnDBInstancePropsMixin(@NotNull CfnDBInstanceMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::Neptune::DBInstance.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnDBInstancePropsMixin

      @Stability(Stable) public CfnDBInstancePropsMixin(@NotNull CfnDBInstanceMixinProps props)
      Create a mixin to apply properties to AWS::Neptune::DBInstance.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnDBInstanceMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()