Class DatabaseInstance
A database instance.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.AWS.RDS.dll
Syntax (csharp)
public class DatabaseInstance : DatabaseInstanceBase, IDatabaseInstance, IResource, IConstruct, IDependable, IConnectable, ISecretAttachmentTarget
Syntax (vb)
Public Class DatabaseInstance
Inherits DatabaseInstanceBase
Implements IDatabaseInstance, IResource, IConstruct, IDependable, IConnectable, ISecretAttachmentTarget
Remarks
Resource: AWS::RDS::DBInstance
ExampleMetadata: infused
Examples
Vpc vpc;
var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_12_3 });
new DatabaseInstance(this, "InstanceWithUsername", new DatabaseInstanceProps {
Engine = engine,
Vpc = vpc,
Credentials = Credentials.FromGeneratedSecret("postgres")
});
new DatabaseInstance(this, "InstanceWithUsernameAndPassword", new DatabaseInstanceProps {
Engine = engine,
Vpc = vpc,
Credentials = Credentials.FromPassword("postgres", SecretValue.SsmSecure("/dbPassword", "1"))
});
var mySecret = Secret.FromSecretName(this, "DBSecret", "myDBLoginInfo");
new DatabaseInstance(this, "InstanceWithSecretLogin", new DatabaseInstanceProps {
Engine = engine,
Vpc = vpc,
Credentials = Credentials.FromSecret(mySecret)
});
Synopsis
Constructors
DatabaseInstance(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
DatabaseInstance(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
DatabaseInstance(Construct, String, IDatabaseInstanceProps) |
Properties
Connections | Access to network connections. |
DbInstanceEndpointAddress | The instance endpoint address. |
DbInstanceEndpointPort | The instance endpoint port. |
EnableIamAuthentication | |
Engine | The engine of this database Instance. |
InstanceEndpoint | The instance endpoint. |
InstanceIdentifier | The instance identifier. |
InstanceType | |
NewCfnProps | |
Secret | The AWS Secrets Manager secret attached to the instance. |
SourceCfnProps | |
Vpc | The VPC where this database instance is deployed. |
VpcPlacement |
Methods
AddRotationMultiUser(String, IRotationMultiUserOptions) | Adds the multi user rotation to this instance. |
AddRotationSingleUser(IRotationSingleUserOptions) | Adds the single user rotation of the master password to this instance. |
SetLogRetention() |
Constructors
DatabaseInstance(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected DatabaseInstance(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
DatabaseInstance(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected DatabaseInstance(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
DatabaseInstance(Construct, String, IDatabaseInstanceProps)
public DatabaseInstance(Construct scope, string id, IDatabaseInstanceProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IDatabaseInstanceProps
Properties
Connections
Access to network connections.
public override Connections_ Connections { get; }
Property Value
Overrides
DbInstanceEndpointAddress
The instance endpoint address.
public override string DbInstanceEndpointAddress { get; }
Property Value
System.String
Overrides
DbInstanceEndpointPort
The instance endpoint port.
public override string DbInstanceEndpointPort { get; }
Property Value
System.String
Overrides
EnableIamAuthentication
protected override Nullable<bool> EnableIamAuthentication { get; set; }
Property Value
System.Nullable<System.Boolean>
Overrides
Engine
The engine of this database Instance.
public override IInstanceEngine Engine { get; }
Property Value
Overrides
Remarks
May be not known for imported Instances if it wasn't provided explicitly, or for read replicas.
InstanceEndpoint
The instance endpoint.
public override Endpoint InstanceEndpoint { get; }
Property Value
Overrides
InstanceIdentifier
The instance identifier.
public override string InstanceIdentifier { get; }
Property Value
System.String
Overrides
InstanceType
NewCfnProps
Secret
The AWS Secrets Manager secret attached to the instance.
public virtual ISecret Secret { get; }
Property Value
SourceCfnProps
Vpc
The VPC where this database instance is deployed.
public virtual IVpc Vpc { get; }
Property Value
VpcPlacement
Methods
AddRotationMultiUser(String, IRotationMultiUserOptions)
Adds the multi user rotation to this instance.
public virtual SecretRotation AddRotationMultiUser(string id, IRotationMultiUserOptions options)
Parameters
- id System.String
- options IRotationMultiUserOptions
Returns
AddRotationSingleUser(IRotationSingleUserOptions)
Adds the single user rotation of the master password to this instance.
public virtual SecretRotation AddRotationSingleUser(IRotationSingleUserOptions options = null)
Parameters
- options IRotationSingleUserOptions
the options for the rotation, if you want to override the defaults.
Returns
SetLogRetention()
protected virtual void SetLogRetention()