DatabaseInstance

class aws_cdk.aws_neptune.DatabaseInstance(scope, id, *, cluster, instance_type, availability_zone=None, db_instance_name=None, parameter_group=None, removal_policy=None)

Bases: aws_cdk.core.Resource

(experimental) A database instance.

Stability

experimental

Resource

AWS::Neptune::DBInstance

Example:

replica1 = neptune.DatabaseInstance(self, "Instance",
    cluster=cluster,
    instance_type=neptune.InstanceType.R5_LARGE
)
Parameters
  • scope (Construct) –

  • id (str) –

  • cluster (IDatabaseCluster) – (experimental) The Neptune database cluster the instance should launch into.

  • instance_type (InstanceType) – (experimental) What type of instance to start for the replicas.

  • availability_zone (Optional[str]) – (experimental) The name of the Availability Zone where the DB instance will be located. Default: - no preference

  • db_instance_name (Optional[str]) – (experimental) A name for the DB instance. If you specify a name, AWS CloudFormation converts it to lowercase. Default: - a CloudFormation generated name

  • parameter_group (Optional[IParameterGroup]) – (experimental) The DB parameter group to associate with the instance. Default: no parameter group

  • removal_policy (Optional[RemovalPolicy]) – (experimental) The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update. Default: RemovalPolicy.Retain

Stability

experimental

Methods

apply_removal_policy(policy)

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters

policy (RemovalPolicy) –

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

cluster

(experimental) The instance’s database cluster.

Stability

experimental

Return type

IDatabaseCluster

db_instance_endpoint_address

(experimental) The instance endpoint address.

Stability

experimental

Inheritdoc

true

Return type

str

db_instance_endpoint_port

(experimental) The instance endpoint port.

Stability

experimental

Inheritdoc

true

Return type

str

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

instance_endpoint

(experimental) The instance endpoint.

Stability

experimental

Inheritdoc

true

Return type

Endpoint

instance_identifier

(experimental) The instance identifier.

Stability

experimental

Inheritdoc

true

Return type

str

node

The construct tree node associated with this construct.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_database_instance_attributes(scope, id, *, instance_endpoint_address, instance_identifier, port)

(experimental) Import an existing database instance.

Parameters
  • scope (Construct) –

  • id (str) –

  • instance_endpoint_address (str) – (experimental) The endpoint address.

  • instance_identifier (str) – (experimental) The instance identifier.

  • port (Union[int, float]) – (experimental) The database port.

Stability

experimental

Return type

IDatabaseInstance

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters

construct (IConstruct) –

Return type

bool