Class CfnDBInstance
- All Implemented Interfaces:
IConstruct
,IDependable
,IInspectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
AWS::Neptune::DBInstance
.
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 AWS 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 AWS CloudFormation behavior depends on the DBClusterIdentifier
property:
- For
AWS::Neptune::DBInstance
resources that don't specify theDBClusterIdentifier
property, AWS CloudFormation saves a snapshot of the DB instance. - For
AWS::Neptune::DBInstance
resources that do specify theDBClusterIdentifier
property, AWS CloudFormation deletes the DB instance.
Deleting DB Instances
If a DB instance is deleted or replaced during an update, AWS 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, AWS 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 AWS 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.services.neptune.*; CfnDBInstance cfnDBInstance = CfnDBInstance.Builder.create(this, "MyCfnDBInstance") .dbInstanceClass("dbInstanceClass") // the properties below are optional .allowMajorVersionUpgrade(false) .autoMinorVersionUpgrade(false) .availabilityZone("availabilityZone") .dbClusterIdentifier("dbClusterIdentifier") .dbInstanceIdentifier("dbInstanceIdentifier") .dbParameterGroupName("dbParameterGroupName") .dbSnapshotIdentifier("dbSnapshotIdentifier") .dbSubnetGroupName("dbSubnetGroupName") .preferredMaintenanceWindow("preferredMaintenanceWindow") .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionCfnDBInstance
(Construct scope, String id, CfnDBInstanceProps props) Create a newAWS::Neptune::DBInstance
.protected
CfnDBInstance
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnDBInstance
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionIndicates that major version upgrades are allowed.The connection endpoint for the database.The port number on which the database accepts connections.Indicates that minor version patches are applied automatically.Specifies the name of the Availability Zone the DB instance is located in.If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.Contains the name of the compute and memory capacity class of the DB instance.Contains a user-supplied database identifier.The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template.This parameter is not supported.A DB subnet group to associate with the DB instance.Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).getTags()
An arbitrary set of tags (key-value pairs) for this DB instance.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
Indicates that major version upgrades are allowed.void
Indicates that major version upgrades are allowed.void
Indicates that minor version patches are applied automatically.void
Indicates that minor version patches are applied automatically.void
setAvailabilityZone
(String value) Specifies the name of the Availability Zone the DB instance is located in.void
setDbClusterIdentifier
(String value) If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of.void
setDbInstanceClass
(String value) Contains the name of the compute and memory capacity class of the DB instance.void
setDbInstanceIdentifier
(String value) Contains a user-supplied database identifier.void
setDbParameterGroupName
(String value) The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template.void
setDbSnapshotIdentifier
(String value) This parameter is not supported.void
setDbSubnetGroupName
(String value) A DB subnet group to associate with the DB instance.void
Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.core.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 newAWS::Neptune::DBInstance
.- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
props
-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrEndpoint
The connection endpoint for the database.For example:
mystack-mydb-1apw1j4phylrk.cg034hpkmmjt.us-east-2.rds.amazonaws.com
. -
getAttrPort
The port number on which the database accepts connections.For example:
8182
. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
An arbitrary set of tags (key-value pairs) for this DB instance. -
getDbInstanceClass
Contains the name of the compute and memory capacity class of the DB instance.If you update this property, some interruptions may occur.
-
setDbInstanceClass
Contains the name of the compute and memory capacity class of the DB instance.If you update this property, some interruptions may occur.
-
getAllowMajorVersionUpgrade
Indicates that major version upgrades are allowed.Changing this parameter doesn't result in an outage and the change is asynchronously applied as soon as possible. This parameter must be set to true when specifying a value for the EngineVersion parameter that is a different major version than the DB instance's current version.
When you change this parameter for an existing DB cluster, CloudFormation will replace your existing DB cluster with a new, empty one that uses the engine version you specified.
-
setAllowMajorVersionUpgrade
Indicates that major version upgrades are allowed.Changing this parameter doesn't result in an outage and the change is asynchronously applied as soon as possible. This parameter must be set to true when specifying a value for the EngineVersion parameter that is a different major version than the DB instance's current version.
When you change this parameter for an existing DB cluster, CloudFormation will replace your existing DB cluster with a new, empty one that uses the engine version you specified.
-
setAllowMajorVersionUpgrade
Indicates that major version upgrades are allowed.Changing this parameter doesn't result in an outage and the change is asynchronously applied as soon as possible. This parameter must be set to true when specifying a value for the EngineVersion parameter that is a different major version than the DB instance's current version.
When you change this parameter for an existing DB cluster, CloudFormation will replace your existing DB cluster with a new, empty one that uses the engine version you specified.
-
getAutoMinorVersionUpgrade
Indicates that minor version patches are applied automatically.When updating this property, some interruptions may occur.
-
setAutoMinorVersionUpgrade
Indicates that minor version patches are applied automatically.When updating this property, some interruptions may occur.
-
setAutoMinorVersionUpgrade
Indicates that minor version patches are applied automatically.When updating this property, some interruptions may occur.
-
getAvailabilityZone
Specifies the name of the Availability Zone the DB instance is located in. -
setAvailabilityZone
Specifies the name of the Availability Zone the DB instance is located in. -
getDbClusterIdentifier
If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of. -
setDbClusterIdentifier
If the DB instance is a member of a DB cluster, contains the name of the DB cluster that the DB instance is a member of. -
getDbInstanceIdentifier
Contains a user-supplied database identifier.This identifier is the unique key that identifies a DB instance.
-
setDbInstanceIdentifier
Contains a user-supplied database identifier.This identifier is the unique key that identifies a DB instance.
-
getDbParameterGroupName
The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template.If any of the data members of the referenced parameter group are changed during an update, the DB instance might need to be restarted, which causes some interruption. If the parameter group contains static parameters, whether they were changed or not, an update triggers a reboot.
-
setDbParameterGroupName
The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template.If any of the data members of the referenced parameter group are changed during an update, the DB instance might need to be restarted, which causes some interruption. If the parameter group contains static parameters, whether they were changed or not, an update triggers a reboot.
-
getDbSnapshotIdentifier
This parameter is not supported.AWS::Neptune::DBInstance
does not support restoring from snapshots.AWS::Neptune::DBCluster
does support restoring from snapshots. -
setDbSnapshotIdentifier
This parameter is not supported.AWS::Neptune::DBInstance
does not support restoring from snapshots.AWS::Neptune::DBCluster
does support restoring from snapshots. -
getDbSubnetGroupName
A DB subnet group to associate with the DB instance.If you update this value, the new subnet group must be a subnet group in a new virtual private cloud (VPC).
-
setDbSubnetGroupName
A DB subnet group to associate with the DB instance.If you update this value, the new subnet group must be a subnet group in a new virtual private cloud (VPC).
-
getPreferredMaintenanceWindow
Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). -
setPreferredMaintenanceWindow
Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
-