@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:41.452Z") @Stability(value=Stable) public class DatabaseInstance extends DatabaseInstanceBase implements IDatabaseInstance
Example:
Vpc vpc;
// Simple secret
Secret secret = new Secret(this, "Secret");
// Using the secret
DatabaseInstance instance1 = DatabaseInstance.Builder.create(this, "PostgresInstance1")
.engine(DatabaseInstanceEngine.POSTGRES)
.credentials(Credentials.fromSecret(secret))
.vpc(vpc)
.build();
// Templated secret with username and password fields
Secret templatedSecret = Secret.Builder.create(this, "TemplatedSecret")
.generateSecretString(SecretStringGenerator.builder()
.secretStringTemplate(JSON.stringify(Map.of("username", "postgres")))
.generateStringKey("password")
.build())
.build();
// Using the templated secret as credentials
DatabaseInstance instance2 = DatabaseInstance.Builder.create(this, "PostgresInstance2")
.engine(DatabaseInstanceEngine.POSTGRES)
.credentials(Map.of(
"username", templatedSecret.secretValueFromJson("username").toString(),
"password", templatedSecret.secretValueFromJson("password")))
.vpc(vpc)
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
DatabaseInstance.Builder
A fluent builder for
DatabaseInstance. |
software.amazon.jsii.JsiiObject.InitializationModeIDatabaseInstance.Jsii$Default, IDatabaseInstance.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
DatabaseInstance(software.constructs.Construct scope,
String id,
DatabaseInstanceProps props) |
protected |
DatabaseInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
DatabaseInstance(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
SecretRotation |
addRotationMultiUser(String id,
RotationMultiUserOptions options)
Adds the multi user rotation to this instance.
|
SecretRotation |
addRotationSingleUser()
Adds the single user rotation of the master password to this instance.
|
SecretRotation |
addRotationSingleUser(RotationSingleUserOptions options)
Adds the single user rotation of the master password to this instance.
|
Connections |
getConnections()
Access to network connections.
|
String |
getDbInstanceEndpointAddress()
The instance endpoint address.
|
String |
getDbInstanceEndpointPort()
The instance endpoint port.
|
protected Boolean |
getEnableIamAuthentication() |
IInstanceEngine |
getEngine()
The engine of this database Instance.
|
Endpoint |
getInstanceEndpoint()
The instance endpoint.
|
String |
getInstanceIdentifier()
The instance identifier.
|
protected InstanceType |
getInstanceType() |
protected CfnDBInstanceProps |
getNewCfnProps() |
ISecret |
getSecret()
The AWS Secrets Manager secret attached to the instance.
|
protected CfnDBInstanceProps |
getSourceCfnProps() |
IVpc |
getVpc()
The VPC where this database instance is deployed.
|
protected SubnetSelection |
getVpcPlacement() |
protected void |
setEnableIamAuthentication(Boolean value) |
protected void |
setLogRetention() |
addProxy, asSecretAttachmentTarget, fromDatabaseInstanceAttributes, getInstanceArn, grantConnect, metric, metric, metricCPUUtilization, metricCPUUtilization, metricDatabaseConnections, metricDatabaseConnections, metricFreeableMemory, metricFreeableMemory, metricFreeStorageSpace, metricFreeStorageSpace, metricReadIOPS, metricReadIOPS, metricWriteIOPS, metricWriteIOPS, onEvent, onEventapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddProxy, getInstanceArn, grantConnect, metric, metric, metricCPUUtilization, metricCPUUtilization, metricDatabaseConnections, metricDatabaseConnections, metricFreeableMemory, metricFreeableMemory, metricFreeStorageSpace, metricFreeStorageSpace, metricReadIOPS, metricReadIOPS, metricWriteIOPS, metricWriteIOPS, onEvent, onEventapplyRemovalPolicy, getEnv, getStackasSecretAttachmentTargetprotected DatabaseInstance(software.amazon.jsii.JsiiObjectRef objRef)
protected DatabaseInstance(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public DatabaseInstance(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
DatabaseInstanceProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public SecretRotation addRotationMultiUser(@NotNull String id, @NotNull RotationMultiUserOptions options)
id - This parameter is required.options - This parameter is required.@Stability(value=Stable) @NotNull public SecretRotation addRotationSingleUser(@Nullable RotationSingleUserOptions options)
options - the options for the rotation, if you want to override the defaults.@Stability(value=Stable) @NotNull public SecretRotation addRotationSingleUser()
@Stability(value=Stable) protected void setLogRetention()
@Stability(value=Stable) @NotNull public Connections getConnections()
getConnections in interface IConnectablegetConnections in class DatabaseInstanceBase@Stability(value=Stable) @NotNull public String getDbInstanceEndpointAddress()
getDbInstanceEndpointAddress in interface IDatabaseInstancegetDbInstanceEndpointAddress in class DatabaseInstanceBase@Stability(value=Stable) @NotNull public String getDbInstanceEndpointPort()
getDbInstanceEndpointPort in interface IDatabaseInstancegetDbInstanceEndpointPort in class DatabaseInstanceBase@Stability(value=Stable) @NotNull public Endpoint getInstanceEndpoint()
getInstanceEndpoint in interface IDatabaseInstancegetInstanceEndpoint in class DatabaseInstanceBase@Stability(value=Stable) @NotNull public String getInstanceIdentifier()
getInstanceIdentifier in interface IDatabaseInstancegetInstanceIdentifier in class DatabaseInstanceBase@Stability(value=Stable) @NotNull protected InstanceType getInstanceType()
@Stability(value=Stable) @NotNull protected CfnDBInstanceProps getNewCfnProps()
@Stability(value=Stable) @NotNull protected CfnDBInstanceProps getSourceCfnProps()
@Stability(value=Stable) @NotNull public IVpc getVpc()
@Stability(value=Stable) @Nullable public IInstanceEngine getEngine()
May be not known for imported Instances if it wasn't provided explicitly, or for read replicas.
getEngine in interface IDatabaseInstancegetEngine in class DatabaseInstanceBase@Stability(value=Stable) @Nullable public ISecret getSecret()
@Stability(value=Stable) @Nullable protected SubnetSelection getVpcPlacement()
@Stability(value=Stable) @Nullable protected Boolean getEnableIamAuthentication()
getEnableIamAuthentication in class DatabaseInstanceBase@Stability(value=Stable)
protected void setEnableIamAuthentication(@Nullable
Boolean value)
setEnableIamAuthentication in class DatabaseInstanceBaseCopyright © 2022. All rights reserved.