@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:41.007Z") @Stability(value=Stable) 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
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")
.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. |
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnDBInstance(software.constructs.Construct scope,
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 |
|---|---|
Object |
getAllowMajorVersionUpgrade()
Indicates that major version upgrades are allowed.
|
String |
getAttrEndpoint()
The connection endpoint for the database.
|
String |
getAttrPort()
The port number on which the database accepts connections.
|
Object |
getAutoMinorVersionUpgrade()
Indicates that minor version patches are applied automatically.
|
String |
getAvailabilityZone()
Specifies the name of the Availability Zone the DB instance is located in.
|
protected Map<String,Object> |
getCfnProperties() |
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.
|
String |
getDbInstanceClass()
Contains the name of the compute and memory capacity class of the DB instance.
|
String |
getDbInstanceIdentifier()
Contains a user-supplied database identifier.
|
String |
getDbParameterGroupName()
The name of an existing DB parameter group or a reference to an AWS::Neptune::DBParameterGroup resource created in the template.
|
String |
getDbSnapshotIdentifier()
This parameter is not supported.
|
String |
getDbSubnetGroupName()
A DB subnet group to associate with the DB instance.
|
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 Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAllowMajorVersionUpgrade(Boolean value)
Indicates that major version upgrades are allowed.
|
void |
setAllowMajorVersionUpgrade(IResolvable value)
Indicates that major version upgrades are allowed.
|
void |
setAutoMinorVersionUpgrade(Boolean value)
Indicates that minor version patches are applied automatically.
|
void |
setAutoMinorVersionUpgrade(IResolvable value)
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 |
setPreferredMaintenanceWindow(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, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnDBInstance(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnDBInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnDBInstance(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
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.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrEndpoint()
For example: mystack-mydb-1apw1j4phylrk.cg034hpkmmjt.us-east-2.rds.amazonaws.com .
@Stability(value=Stable) @NotNull public String getAttrPort()
For example: 8182 .
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
@Stability(value=Stable) @NotNull public String getDbInstanceClass()
If you update this property, some interruptions may occur.
@Stability(value=Stable)
public void setDbInstanceClass(@NotNull
String value)
If you update this property, some interruptions may occur.
@Stability(value=Stable) @Nullable public 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.
@Stability(value=Stable)
public void setAllowMajorVersionUpgrade(@Nullable
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.
@Stability(value=Stable)
public void setAllowMajorVersionUpgrade(@Nullable
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.
@Stability(value=Stable) @Nullable public Object getAutoMinorVersionUpgrade()
When updating this property, some interruptions may occur.
@Stability(value=Stable)
public void setAutoMinorVersionUpgrade(@Nullable
Boolean value)
When updating this property, some interruptions may occur.
@Stability(value=Stable)
public void setAutoMinorVersionUpgrade(@Nullable
IResolvable value)
When updating this property, some interruptions may occur.
@Stability(value=Stable) @Nullable public String getAvailabilityZone()
@Stability(value=Stable)
public void setAvailabilityZone(@Nullable
String value)
@Stability(value=Stable) @Nullable public String getDbClusterIdentifier()
@Stability(value=Stable)
public void setDbClusterIdentifier(@Nullable
String value)
@Stability(value=Stable) @Nullable public String getDbInstanceIdentifier()
This identifier is the unique key that identifies a DB instance.
@Stability(value=Stable)
public void setDbInstanceIdentifier(@Nullable
String value)
This identifier is the unique key that identifies a DB instance.
@Stability(value=Stable) @Nullable public 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.
@Stability(value=Stable)
public void setDbParameterGroupName(@Nullable
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.
@Stability(value=Stable) @Nullable public String getDbSnapshotIdentifier()
AWS::Neptune::DBInstance does not support restoring from snapshots.
AWS::Neptune::DBCluster does support restoring from snapshots.
@Stability(value=Stable)
public void setDbSnapshotIdentifier(@Nullable
String value)
AWS::Neptune::DBInstance does not support restoring from snapshots.
AWS::Neptune::DBCluster does support restoring from snapshots.
@Stability(value=Stable) @Nullable public String getDbSubnetGroupName()
If you update this value, the new subnet group must be a subnet group in a new virtual private cloud (VPC).
@Stability(value=Stable)
public void setDbSubnetGroupName(@Nullable
String value)
If you update this value, the new subnet group must be a subnet group in a new virtual private cloud (VPC).
@Stability(value=Stable) @Nullable public String getPreferredMaintenanceWindow()
@Stability(value=Stable)
public void setPreferredMaintenanceWindow(@Nullable
String value)
Copyright © 2022. All rights reserved.