Class CfnDBInstancePropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
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::DBInstanceresources that don't specify theDBClusterIdentifierproperty, CloudFormation saves a snapshot of the DB instance. - For
AWS::Neptune::DBInstanceresources that do specify theDBClusterIdentifierproperty, 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
DBSnapshotIdentifierproperty 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnDBInstancePropsMixin.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::Neptune::DBInstance.CfnDBInstancePropsMixin(CfnDBInstanceMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::Neptune::DBInstance.protectedCfnDBInstancePropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDBInstancePropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnDBInstanceMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 toAWS::Neptune::DBInstance.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnDBInstancePropsMixin
Create a mixin to apply properties toAWS::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. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-