Class CfnDBInstance
- All Implemented Interfaces:
IInspectable,IEnvironmentAware,IDBInstanceRef,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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.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")
.publiclyAccessible(false)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.neptune.IDBInstanceRef
IDBInstanceRef.Jsii$Default, IDBInstanceRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnDBInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnDBInstance(software.amazon.jsii.JsiiObjectRef objRef) CfnDBInstance(software.constructs.Construct scope, String id, CfnDBInstanceProps props) Create a newAWS::Neptune::DBInstance. -
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.A reference to a DBInstance resource.The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template.Deprecated.this property has been deprecatedA 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).Indicates whether the DB instance is publicly accessible.getTags()Tag Manager which manages the tags for this resource.An arbitrary set of tags (key-value pairs) for this DB instance.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnDBInstance.renderProperties(Map<String, Object> props) voidIndicates that major version upgrades are allowed.voidIndicates that major version upgrades are allowed.voidIndicates that minor version patches are applied automatically.voidIndicates that minor version patches are applied automatically.voidsetAvailabilityZone(String value) Specifies the name of the Availability Zone the DB instance is located in.voidsetDbClusterIdentifier(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.voidsetDbInstanceClass(String value) Contains the name of the compute and memory capacity class of the DB instance.voidsetDbInstanceIdentifier(String value) Contains a user-supplied database identifier.voidsetDbParameterGroupName(String value) The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template.voidsetDbSnapshotIdentifier(String value) Deprecated.this property has been deprecatedvoidsetDbSubnetGroupName(String value) A DB subnet group to associate with the DB instance.voidSpecifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).voidsetPubliclyAccessible(Boolean value) Indicates whether the DB instance is publicly accessible.voidsetPubliclyAccessible(IResolvable value) Indicates whether the DB instance is publicly accessible.voidsetTagsRaw(List<CfnTag> value) An arbitrary set of tags (key-value pairs) for this DB instance.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnDBInstanceProps props) Create a newAWS::Neptune::DBInstance.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
isCfnDBInstance
Checks whether the given object is a CfnDBInstance.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- 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:
renderPropertiesin 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:
getCfnPropertiesin classCfnResource
-
getDbInstanceRef
A reference to a DBInstance resource.- Specified by:
getDbInstanceRefin interfaceIDBInstanceRef
-
getTags
Tag Manager which manages the tags for this resource. -
getDbInstanceClass
Contains the name of the compute and memory capacity class of the DB instance. -
setDbInstanceClass
Contains the name of the compute and memory capacity class of the DB instance. -
getAllowMajorVersionUpgrade
Indicates that major version upgrades are allowed.Returns union: either
BooleanorIResolvable -
setAllowMajorVersionUpgrade
Indicates that major version upgrades are allowed. -
setAllowMajorVersionUpgrade
Indicates that major version upgrades are allowed. -
getAutoMinorVersionUpgrade
Indicates that minor version patches are applied automatically.Returns union: either
BooleanorIResolvable -
setAutoMinorVersionUpgrade
Indicates that minor version patches are applied automatically. -
setAutoMinorVersionUpgrade
Indicates that minor version patches are applied automatically. -
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. -
setDbInstanceIdentifier
Contains a user-supplied database identifier. -
getDbParameterGroupName
The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template. -
setDbParameterGroupName
The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template. -
getDbSnapshotIdentifier
Deprecated.this property has been deprecated(deprecated) This parameter is not supported. -
setDbSnapshotIdentifier
Deprecated.this property has been deprecated(deprecated) This parameter is not supported. -
getDbSubnetGroupName
A DB subnet group to associate with the DB instance. -
setDbSubnetGroupName
A DB subnet group to associate with the DB instance. -
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). -
getPubliclyAccessible
Indicates whether the DB instance is publicly accessible.Returns union: either
BooleanorIResolvable -
setPubliclyAccessible
Indicates whether the DB instance is publicly accessible. -
setPubliclyAccessible
Indicates whether the DB instance is publicly accessible. -
getTagsRaw
An arbitrary set of tags (key-value pairs) for this DB instance. -
setTagsRaw
An arbitrary set of tags (key-value pairs) for this DB instance.
-