@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:43.806Z") public class CfnDBInstance extends CfnResource implements IInspectable
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:
AWS::Neptune::DBInstance
resources that don't specify the DBClusterIdentifier
property, AWS CloudFormation saves a snapshot of the DB instance.AWS::Neptune::DBInstance
resources that do specify the DBClusterIdentifier
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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnDBInstance.Builder
A fluent builder for
CfnDBInstance . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnDBInstance(Construct scope,
java.lang.String id,
CfnDBInstanceProps props)
Create a new `AWS::Neptune::DBInstance`.
|
protected |
CfnDBInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnDBInstance(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAllowMajorVersionUpgrade()
Indicates that major version upgrades are allowed.
|
java.lang.String |
getAttrEndpoint()
The connection endpoint for the database.
|
java.lang.String |
getAttrPort()
The port number on which the database accepts connections.
|
java.lang.Object |
getAutoMinorVersionUpgrade()
Indicates that minor version patches are applied automatically.
|
java.lang.String |
getAvailabilityZone()
Specifies the name of the Availability Zone the DB instance is located in.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
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.
|
java.lang.String |
getDbInstanceClass()
Contains the name of the compute and memory capacity class of the DB instance.
|
java.lang.String |
getDbInstanceIdentifier()
Contains a user-supplied database identifier.
|
java.lang.String |
getDbParameterGroupName()
The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template.
|
java.lang.String |
getDbSnapshotIdentifier()
This parameter is not supported.
|
java.lang.String |
getDbSubnetGroupName()
A DB subnet group to associate with the DB instance.
|
java.lang.String |
getPreferredMaintenanceWindow()
Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
|
TagManager |
getTags()
An arbitrary set of tags (key-value pairs) for this DB instance.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setAllowMajorVersionUpgrade(java.lang.Boolean value)
Indicates that major version upgrades are allowed.
|
void |
setAllowMajorVersionUpgrade(IResolvable value)
Indicates that major version upgrades are allowed.
|
void |
setAutoMinorVersionUpgrade(java.lang.Boolean value)
Indicates that minor version patches are applied automatically.
|
void |
setAutoMinorVersionUpgrade(IResolvable value)
Indicates that minor version patches are applied automatically.
|
void |
setAvailabilityZone(java.lang.String value)
Specifies the name of the Availability Zone the DB instance is located in.
|
void |
setDbClusterIdentifier(java.lang.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(java.lang.String value)
Contains the name of the compute and memory capacity class of the DB instance.
|
void |
setDbInstanceIdentifier(java.lang.String value)
Contains a user-supplied database identifier.
|
void |
setDbParameterGroupName(java.lang.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(java.lang.String value)
This parameter is not supported.
|
void |
setDbSubnetGroupName(java.lang.String value)
A DB subnet group to associate with the DB instance.
|
void |
setPreferredMaintenanceWindow(java.lang.String value)
Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnDBInstance(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnDBInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnDBInstance(Construct scope, java.lang.String id, CfnDBInstanceProps props)
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.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrEndpoint()
For example: mystack-mydb-1apw1j4phylrk.cg034hpkmmjt.us-east-2.rds.amazonaws.com
.
public java.lang.String getAttrPort()
For example: 8182
.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
public java.lang.String getDbInstanceClass()
If you update this property, some interruptions may occur.
public void setDbInstanceClass(java.lang.String value)
If you update this property, some interruptions may occur.
public java.lang.Object getAllowMajorVersionUpgrade()
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.
public void setAllowMajorVersionUpgrade(java.lang.Boolean value)
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.
public void setAllowMajorVersionUpgrade(IResolvable value)
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.
public java.lang.Object getAutoMinorVersionUpgrade()
When updating this property, some interruptions may occur.
public void setAutoMinorVersionUpgrade(java.lang.Boolean value)
When updating this property, some interruptions may occur.
public void setAutoMinorVersionUpgrade(IResolvable value)
When updating this property, some interruptions may occur.
public java.lang.String getAvailabilityZone()
public void setAvailabilityZone(java.lang.String value)
public java.lang.String getDbClusterIdentifier()
public void setDbClusterIdentifier(java.lang.String value)
public java.lang.String getDbInstanceIdentifier()
This identifier is the unique key that identifies a DB instance.
public void setDbInstanceIdentifier(java.lang.String value)
This identifier is the unique key that identifies a DB instance.
public java.lang.String getDbParameterGroupName()
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.
public void setDbParameterGroupName(java.lang.String value)
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.
public java.lang.String getDbSnapshotIdentifier()
AWS::Neptune::DBInstance
does not support restoring from snapshots.
AWS::Neptune::DBCluster
does support restoring from snapshots.
public void setDbSnapshotIdentifier(java.lang.String value)
AWS::Neptune::DBInstance
does not support restoring from snapshots.
AWS::Neptune::DBCluster
does support restoring from snapshots.
public java.lang.String getDbSubnetGroupName()
If you update this value, the new subnet group must be a subnet group in a new virtual private cloud (VPC).
public void setDbSubnetGroupName(java.lang.String value)
If you update this value, the new subnet group must be a subnet group in a new virtual private cloud (VPC).
public java.lang.String getPreferredMaintenanceWindow()
public void setPreferredMaintenanceWindow(java.lang.String value)