Class DatabaseInstance
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.rds.DatabaseInstanceBase
software.amazon.awscdk.services.rds.DatabaseInstance
- All Implemented Interfaces:
IConstruct,IDependable,IResource,IConnectable,IDatabaseInstance,ISecretAttachmentTarget,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:49.117Z")
@Stability(Stable)
public class DatabaseInstance
extends DatabaseInstanceBase
implements IDatabaseInstance
A database instance.
Example:
Vpc vpc;
IInstanceEngine engine = DatabaseInstanceEngine.postgres(PostgresInstanceEngineProps.builder().version(PostgresEngineVersion.VER_12_3).build());
DatabaseInstance.Builder.create(this, "InstanceWithUsername")
.engine(engine)
.vpc(vpc)
.credentials(Credentials.fromGeneratedSecret("postgres"))
.build();
DatabaseInstance.Builder.create(this, "InstanceWithUsernameAndPassword")
.engine(engine)
.vpc(vpc)
.credentials(Credentials.fromPassword("postgres", SecretValue.ssmSecure("/dbPassword", "1")))
.build();
ISecret mySecret = Secret.fromSecretName(this, "DBSecret", "myDBLoginInfo");
DatabaseInstance.Builder.create(this, "InstanceWithSecretLogin")
.engine(engine)
.vpc(vpc)
.credentials(Credentials.fromSecret(mySecret))
.build();
-
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.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.rds.IDatabaseInstance
IDatabaseInstance.Jsii$Default, IDatabaseInstance.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDatabaseInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedDatabaseInstance(software.amazon.jsii.JsiiObjectRef objRef) DatabaseInstance(software.constructs.Construct scope, String id, DatabaseInstanceProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddRotationMultiUser(String id, RotationMultiUserOptions options) Adds the multi user rotation to this instance.Adds the single user rotation of the master password to this instance.Adds the single user rotation of the master password to this instance.Access to network connections.The instance endpoint address.The instance endpoint port.protected BooleanThe engine of this database Instance.The instance endpoint.The instance identifier.protected InstanceTypeprotected CfnDBInstancePropsThe AWS Secrets Manager secret attached to the instance.protected CfnDBInstancePropsgetVpc()The VPC where this database instance is deployed.protected SubnetSelectionprotected voidprotected voidMethods inherited from class software.amazon.awscdk.services.rds.DatabaseInstanceBase
addProxy, asSecretAttachmentTarget, fromDatabaseInstanceAttributes, getInstanceArn, grantConnect, metric, metric, metricCPUUtilization, metricCPUUtilization, metricDatabaseConnections, metricDatabaseConnections, metricFreeableMemory, metricFreeableMemory, metricFreeStorageSpace, metricFreeStorageSpace, metricReadIOPS, metricReadIOPS, metricWriteIOPS, metricWriteIOPS, onEvent, onEventMethods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.constructs.Construct
toStringMethods 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.amazon.awscdk.core.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.services.rds.IDatabaseInstance
addProxy, getInstanceArn, grantConnect, metric, metric, metricCPUUtilization, metricCPUUtilization, metricDatabaseConnections, metricDatabaseConnections, metricFreeableMemory, metricFreeableMemory, metricFreeStorageSpace, metricFreeStorageSpace, metricReadIOPS, metricReadIOPS, metricWriteIOPS, metricWriteIOPS, onEvent, onEventMethods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.awscdk.services.secretsmanager.ISecretAttachmentTarget
asSecretAttachmentTargetMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
DatabaseInstance
protected DatabaseInstance(software.amazon.jsii.JsiiObjectRef objRef) -
DatabaseInstance
protected DatabaseInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
DatabaseInstance
@Stability(Stable) public DatabaseInstance(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DatabaseInstanceProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
addRotationMultiUser
@Stability(Stable) @NotNull public SecretRotation addRotationMultiUser(@NotNull String id, @NotNull RotationMultiUserOptions options) Adds the multi user rotation to this instance.- Parameters:
id- This parameter is required.options- This parameter is required.
-
addRotationSingleUser
@Stability(Stable) @NotNull public SecretRotation addRotationSingleUser(@Nullable RotationSingleUserOptions options) Adds the single user rotation of the master password to this instance.- Parameters:
options- the options for the rotation, if you want to override the defaults.
-
addRotationSingleUser
Adds the single user rotation of the master password to this instance. -
setLogRetention
@Stability(Stable) protected void setLogRetention() -
getConnections
Access to network connections.- Specified by:
getConnectionsin interfaceIConnectable- Specified by:
getConnectionsin classDatabaseInstanceBase
-
getDbInstanceEndpointAddress
The instance endpoint address.- Specified by:
getDbInstanceEndpointAddressin interfaceIDatabaseInstance- Specified by:
getDbInstanceEndpointAddressin classDatabaseInstanceBase
-
getDbInstanceEndpointPort
The instance endpoint port.- Specified by:
getDbInstanceEndpointPortin interfaceIDatabaseInstance- Specified by:
getDbInstanceEndpointPortin classDatabaseInstanceBase
-
getInstanceEndpoint
The instance endpoint.- Specified by:
getInstanceEndpointin interfaceIDatabaseInstance- Specified by:
getInstanceEndpointin classDatabaseInstanceBase
-
getInstanceIdentifier
The instance identifier.- Specified by:
getInstanceIdentifierin interfaceIDatabaseInstance- Specified by:
getInstanceIdentifierin classDatabaseInstanceBase
-
getInstanceType
-
getNewCfnProps
-
getSourceCfnProps
-
getVpc
The VPC where this database instance is deployed. -
getEngine
The engine of this database Instance.May be not known for imported Instances if it wasn't provided explicitly, or for read replicas.
- Specified by:
getEnginein interfaceIDatabaseInstance- Specified by:
getEnginein classDatabaseInstanceBase
-
getSecret
The AWS Secrets Manager secret attached to the instance. -
getVpcPlacement
-
getEnableIamAuthentication
- Specified by:
getEnableIamAuthenticationin classDatabaseInstanceBase
-
setEnableIamAuthentication
- Specified by:
setEnableIamAuthenticationin classDatabaseInstanceBase
-