Class CfnDBCluster

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:40.290Z") @Stability(Stable) public class CfnDBCluster extends CfnResource implements IInspectable
A CloudFormation AWS::Neptune::DBCluster.

The AWS::Neptune::DBCluster resource creates an Amazon Neptune DB cluster. Neptune is a fully managed graph database.

Currently, you can create this resource only in AWS Regions in which Amazon Neptune is supported.

If no DeletionPolicy is set for AWS::Neptune::DBCluster resources, the default deletion behavior is that the entire volume will be deleted without a snapshot. To retain a backup of the volume, the DeletionPolicy should be set to Snapshot . For more information about how AWS CloudFormation deletes resources, see DeletionPolicy Attribute .

You can use AWS::Neptune::DBCluster.DeletionProtection to help guard against unintended deletion of your DB cluster.

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.*;
 CfnDBCluster cfnDBCluster = CfnDBCluster.Builder.create(this, "MyCfnDBCluster")
         .associatedRoles(List.of(DBClusterRoleProperty.builder()
                 .roleArn("roleArn")
                 // the properties below are optional
                 .featureName("featureName")
                 .build()))
         .availabilityZones(List.of("availabilityZones"))
         .backupRetentionPeriod(123)
         .copyTagsToSnapshot(false)
         .dbClusterIdentifier("dbClusterIdentifier")
         .dbClusterParameterGroupName("dbClusterParameterGroupName")
         .dbInstanceParameterGroupName("dbInstanceParameterGroupName")
         .dbSubnetGroupName("dbSubnetGroupName")
         .deletionProtection(false)
         .enableCloudwatchLogsExports(List.of("enableCloudwatchLogsExports"))
         .engineVersion("engineVersion")
         .iamAuthEnabled(false)
         .kmsKeyId("kmsKeyId")
         .port(123)
         .preferredBackupWindow("preferredBackupWindow")
         .preferredMaintenanceWindow("preferredMaintenanceWindow")
         .restoreToTime("restoreToTime")
         .restoreType("restoreType")
         .serverlessScalingConfiguration(ServerlessScalingConfigurationProperty.builder()
                 .maxCapacity(123)
                 .minCapacity(123)
                 .build())
         .snapshotIdentifier("snapshotIdentifier")
         .sourceDbClusterIdentifier("sourceDbClusterIdentifier")
         .storageEncrypted(false)
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .useLatestRestorableTime(false)
         .vpcSecurityGroupIds(List.of("vpcSecurityGroupIds"))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnDBCluster

      protected CfnDBCluster(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnDBCluster

      protected CfnDBCluster(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnDBCluster

      @Stability(Stable) public CfnDBCluster(@NotNull Construct scope, @NotNull String id, @Nullable CfnDBClusterProps props)
      Create a new AWS::Neptune::DBCluster.

      Parameters:
      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.
    • CfnDBCluster

      @Stability(Stable) public CfnDBCluster(@NotNull Construct scope, @NotNull String id)
      Create a new AWS::Neptune::DBCluster.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrClusterResourceId

      @Stability(Stable) @NotNull public String getAttrClusterResourceId()
      The resource id for the DB cluster.

      For example: cluster-ABCD1234EFGH5678IJKL90MNOP . The cluster ID uniquely identifies the cluster and is used in things like IAM authentication policies.

    • getAttrEndpoint

      @Stability(Stable) @NotNull public String getAttrEndpoint()
      The connection endpoint for the DB cluster.

      For example: mystack-mydbcluster-1apw1j4phylrk.cg034hpkmmjt.us-east-2.rds.amazonaws.com

    • getAttrPort

      @Stability(Stable) @NotNull public String getAttrPort()
      The port number on which the DB cluster accepts connections.

      For example: 8182 .

    • getAttrReadEndpoint

      @Stability(Stable) @NotNull public String getAttrReadEndpoint()
      The reader endpoint for the DB cluster.

      For example: mystack-mydbcluster-ro-1apw1j4phylrk.cg034hpkmmjt.us-east-2.rds.amazonaws.com

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      The tags assigned to this cluster.
    • getAssociatedRoles

      @Stability(Stable) @Nullable public Object getAssociatedRoles()
      Provides a list of the Amazon Identity and Access Management (IAM) roles that are associated with the DB cluster.

      IAM roles that are associated with a DB cluster grant permission for the DB cluster to access other Amazon services on your behalf.

    • setAssociatedRoles

      @Stability(Stable) public void setAssociatedRoles(@Nullable IResolvable value)
      Provides a list of the Amazon Identity and Access Management (IAM) roles that are associated with the DB cluster.

      IAM roles that are associated with a DB cluster grant permission for the DB cluster to access other Amazon services on your behalf.

    • setAssociatedRoles

      @Stability(Stable) public void setAssociatedRoles(@Nullable List<Object> value)
      Provides a list of the Amazon Identity and Access Management (IAM) roles that are associated with the DB cluster.

      IAM roles that are associated with a DB cluster grant permission for the DB cluster to access other Amazon services on your behalf.

    • getAvailabilityZones

      @Stability(Stable) @Nullable public List<String> getAvailabilityZones()
      Provides the list of EC2 Availability Zones that instances in the DB cluster can be created in.
    • setAvailabilityZones

      @Stability(Stable) public void setAvailabilityZones(@Nullable List<String> value)
      Provides the list of EC2 Availability Zones that instances in the DB cluster can be created in.
    • getBackupRetentionPeriod

      @Stability(Stable) @Nullable public Number getBackupRetentionPeriod()
      Specifies the number of days for which automatic DB snapshots are retained.

      An update may require some interruption. See ModifyDBInstance in the Amazon Neptune User Guide for more information.

    • setBackupRetentionPeriod

      @Stability(Stable) public void setBackupRetentionPeriod(@Nullable Number value)
      Specifies the number of days for which automatic DB snapshots are retained.

      An update may require some interruption. See ModifyDBInstance in the Amazon Neptune User Guide for more information.

    • getCopyTagsToSnapshot

      @Stability(Stable) @Nullable public Object getCopyTagsToSnapshot()
      If set to true , tags are copied to any snapshot of the DB cluster that is created..
    • setCopyTagsToSnapshot

      @Stability(Stable) public void setCopyTagsToSnapshot(@Nullable Boolean value)
      If set to true , tags are copied to any snapshot of the DB cluster that is created..
    • setCopyTagsToSnapshot

      @Stability(Stable) public void setCopyTagsToSnapshot(@Nullable IResolvable value)
      If set to true , tags are copied to any snapshot of the DB cluster that is created..
    • getDbClusterIdentifier

      @Stability(Stable) @Nullable public String getDbClusterIdentifier()
      Contains a user-supplied DB cluster identifier.

      This identifier is the unique key that identifies a DB cluster.

    • setDbClusterIdentifier

      @Stability(Stable) public void setDbClusterIdentifier(@Nullable String value)
      Contains a user-supplied DB cluster identifier.

      This identifier is the unique key that identifies a DB cluster.

    • getDbClusterParameterGroupName

      @Stability(Stable) @Nullable public String getDbClusterParameterGroupName()
      Provides the name of the DB cluster parameter group.

      An update may require some interruption. See ModifyDBInstance in the Amazon Neptune User Guide for more information.

    • setDbClusterParameterGroupName

      @Stability(Stable) public void setDbClusterParameterGroupName(@Nullable String value)
      Provides the name of the DB cluster parameter group.

      An update may require some interruption. See ModifyDBInstance in the Amazon Neptune User Guide for more information.

    • getDbInstanceParameterGroupName

      @Stability(Stable) @Nullable public String getDbInstanceParameterGroupName()
      The name of the DB parameter group to apply to all instances of the DB cluster.

      Used only in case of a major engine version upgrade request

      Note that when you apply a parameter group using DBInstanceParameterGroupName , parameter changes are applied immediately, not during the next maintenance window.

      Constraints - The DB parameter group must be in the same DB parameter group family as the target DB cluster version.

      • The DBInstanceParameterGroupName parameter is only valid for major engine version upgrades.
    • setDbInstanceParameterGroupName

      @Stability(Stable) public void setDbInstanceParameterGroupName(@Nullable String value)
      The name of the DB parameter group to apply to all instances of the DB cluster.

      Used only in case of a major engine version upgrade request

      Note that when you apply a parameter group using DBInstanceParameterGroupName , parameter changes are applied immediately, not during the next maintenance window.

      Constraints - The DB parameter group must be in the same DB parameter group family as the target DB cluster version.

      • The DBInstanceParameterGroupName parameter is only valid for major engine version upgrades.
    • getDbSubnetGroupName

      @Stability(Stable) @Nullable public String getDbSubnetGroupName()
      Specifies information on the subnet group associated with the DB cluster, including the name, description, and subnets in the subnet group.
    • setDbSubnetGroupName

      @Stability(Stable) public void setDbSubnetGroupName(@Nullable String value)
      Specifies information on the subnet group associated with the DB cluster, including the name, description, and subnets in the subnet group.
    • getDeletionProtection

      @Stability(Stable) @Nullable public Object getDeletionProtection()
      Indicates whether or not the DB cluster has deletion protection enabled.

      The database can't be deleted when deletion protection is enabled.

    • setDeletionProtection

      @Stability(Stable) public void setDeletionProtection(@Nullable Boolean value)
      Indicates whether or not the DB cluster has deletion protection enabled.

      The database can't be deleted when deletion protection is enabled.

    • setDeletionProtection

      @Stability(Stable) public void setDeletionProtection(@Nullable IResolvable value)
      Indicates whether or not the DB cluster has deletion protection enabled.

      The database can't be deleted when deletion protection is enabled.

    • getEnableCloudwatchLogsExports

      @Stability(Stable) @Nullable public List<String> getEnableCloudwatchLogsExports()
      Specifies a list of log types that are enabled for export to CloudWatch Logs.
    • setEnableCloudwatchLogsExports

      @Stability(Stable) public void setEnableCloudwatchLogsExports(@Nullable List<String> value)
      Specifies a list of log types that are enabled for export to CloudWatch Logs.
    • getEngineVersion

      @Stability(Stable) @Nullable public String getEngineVersion()
      Indicates the database engine version.
    • setEngineVersion

      @Stability(Stable) public void setEngineVersion(@Nullable String value)
      Indicates the database engine version.
    • getIamAuthEnabled

      @Stability(Stable) @Nullable public Object getIamAuthEnabled()
      True if mapping of Amazon Identity and Access Management (IAM) accounts to database accounts is enabled, and otherwise false.
    • setIamAuthEnabled

      @Stability(Stable) public void setIamAuthEnabled(@Nullable Boolean value)
      True if mapping of Amazon Identity and Access Management (IAM) accounts to database accounts is enabled, and otherwise false.
    • setIamAuthEnabled

      @Stability(Stable) public void setIamAuthEnabled(@Nullable IResolvable value)
      True if mapping of Amazon Identity and Access Management (IAM) accounts to database accounts is enabled, and otherwise false.
    • getKmsKeyId

      @Stability(Stable) @Nullable public String getKmsKeyId()
      If StorageEncrypted is true, the Amazon KMS key identifier for the encrypted DB cluster.
    • setKmsKeyId

      @Stability(Stable) public void setKmsKeyId(@Nullable String value)
      If StorageEncrypted is true, the Amazon KMS key identifier for the encrypted DB cluster.
    • getPort

      @Stability(Stable) @Nullable public Number getPort()
      AWS::Neptune::DBCluster.Port.
    • setPort

      @Stability(Stable) public void setPort(@Nullable Number value)
      AWS::Neptune::DBCluster.Port.
    • getPreferredBackupWindow

      @Stability(Stable) @Nullable public String getPreferredBackupWindow()
      Specifies the daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod .

      An update may require some interruption.

    • setPreferredBackupWindow

      @Stability(Stable) public void setPreferredBackupWindow(@Nullable String value)
      Specifies the daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod .

      An update may require some interruption.

    • getPreferredMaintenanceWindow

      @Stability(Stable) @Nullable public String getPreferredMaintenanceWindow()
      Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
    • setPreferredMaintenanceWindow

      @Stability(Stable) public void setPreferredMaintenanceWindow(@Nullable String value)
      Specifies the weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
    • getRestoreToTime

      @Stability(Stable) @Nullable public String getRestoreToTime()
      Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

      If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

      If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

    • setRestoreToTime

      @Stability(Stable) public void setRestoreToTime(@Nullable String value)
      Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

      If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

      If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

    • getRestoreType

      @Stability(Stable) @Nullable public String getRestoreType()
      Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

      If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

      If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

    • setRestoreType

      @Stability(Stable) public void setRestoreType(@Nullable String value)
      Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

      If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

      If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

    • getServerlessScalingConfiguration

      @Stability(Stable) @Nullable public Object getServerlessScalingConfiguration()
      AWS::Neptune::DBCluster.ServerlessScalingConfiguration.
    • setServerlessScalingConfiguration

      @Stability(Stable) public void setServerlessScalingConfiguration(@Nullable IResolvable value)
      AWS::Neptune::DBCluster.ServerlessScalingConfiguration.
    • setServerlessScalingConfiguration

      @Stability(Stable) public void setServerlessScalingConfiguration(@Nullable CfnDBCluster.ServerlessScalingConfigurationProperty value)
      AWS::Neptune::DBCluster.ServerlessScalingConfiguration.
    • getSnapshotIdentifier

      @Stability(Stable) @Nullable public String getSnapshotIdentifier()
      Specifies the identifier for a DB cluster snapshot. Must match the identifier of an existing snapshot.

      After you restore a DB cluster using a SnapshotIdentifier , you must specify the same SnapshotIdentifier for any future updates to the DB cluster. When you specify this property for an update, the DB cluster is not restored from the snapshot again, and the data in the database is not changed.

      However, if you don't specify the SnapshotIdentifier , an empty DB cluster is created, and the original DB cluster is deleted. If you specify a property that is different from the previous snapshot restore property, the DB cluster is restored from the snapshot specified by the SnapshotIdentifier , and the original DB cluster is deleted.

    • setSnapshotIdentifier

      @Stability(Stable) public void setSnapshotIdentifier(@Nullable String value)
      Specifies the identifier for a DB cluster snapshot. Must match the identifier of an existing snapshot.

      After you restore a DB cluster using a SnapshotIdentifier , you must specify the same SnapshotIdentifier for any future updates to the DB cluster. When you specify this property for an update, the DB cluster is not restored from the snapshot again, and the data in the database is not changed.

      However, if you don't specify the SnapshotIdentifier , an empty DB cluster is created, and the original DB cluster is deleted. If you specify a property that is different from the previous snapshot restore property, the DB cluster is restored from the snapshot specified by the SnapshotIdentifier , and the original DB cluster is deleted.

    • getSourceDbClusterIdentifier

      @Stability(Stable) @Nullable public String getSourceDbClusterIdentifier()
      Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

      If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

      If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

    • setSourceDbClusterIdentifier

      @Stability(Stable) public void setSourceDbClusterIdentifier(@Nullable String value)
      Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

      If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

      If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

    • getStorageEncrypted

      @Stability(Stable) @Nullable public Object getStorageEncrypted()
      Indicates whether the DB cluster is encrypted.

      If you specify the DBClusterIdentifier , DBSnapshotIdentifier , or SourceDBInstanceIdentifier property, don't specify this property. The value is inherited from the cluster, snapshot, or source DB instance. If you specify the KmsKeyId property, you must enable encryption.

      If you specify the KmsKeyId , you must enable encryption by setting StorageEncrypted to true.

    • setStorageEncrypted

      @Stability(Stable) public void setStorageEncrypted(@Nullable Boolean value)
      Indicates whether the DB cluster is encrypted.

      If you specify the DBClusterIdentifier , DBSnapshotIdentifier , or SourceDBInstanceIdentifier property, don't specify this property. The value is inherited from the cluster, snapshot, or source DB instance. If you specify the KmsKeyId property, you must enable encryption.

      If you specify the KmsKeyId , you must enable encryption by setting StorageEncrypted to true.

    • setStorageEncrypted

      @Stability(Stable) public void setStorageEncrypted(@Nullable IResolvable value)
      Indicates whether the DB cluster is encrypted.

      If you specify the DBClusterIdentifier , DBSnapshotIdentifier , or SourceDBInstanceIdentifier property, don't specify this property. The value is inherited from the cluster, snapshot, or source DB instance. If you specify the KmsKeyId property, you must enable encryption.

      If you specify the KmsKeyId , you must enable encryption by setting StorageEncrypted to true.

    • getUseLatestRestorableTime

      @Stability(Stable) @Nullable public Object getUseLatestRestorableTime()
      Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

      If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

      If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

    • setUseLatestRestorableTime

      @Stability(Stable) public void setUseLatestRestorableTime(@Nullable Boolean value)
      Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

      If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

      If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

    • setUseLatestRestorableTime

      @Stability(Stable) public void setUseLatestRestorableTime(@Nullable IResolvable value)
      Creates a new DB cluster from a DB snapshot or DB cluster snapshot.

      If a DB snapshot is specified, the target DB cluster is created from the source DB snapshot with a default configuration and default security group.

      If a DB cluster snapshot is specified, the target DB cluster is created from the source DB cluster restore point with the same configuration as the original source DB cluster, except that the new DB cluster is created with the default security group.

    • getVpcSecurityGroupIds

      @Stability(Stable) @Nullable public List<String> getVpcSecurityGroupIds()
      Provides a list of VPC security groups that the DB cluster belongs to.
    • setVpcSecurityGroupIds

      @Stability(Stable) public void setVpcSecurityGroupIds(@Nullable List<String> value)
      Provides a list of VPC security groups that the DB cluster belongs to.