Show / Hide Table of Contents

Class DatabaseInstanceFromSnapshot

A database instance restored from a snapshot.

Inheritance
object
Resource
DatabaseInstanceBase
DatabaseInstanceFromSnapshot
Implements
IDatabaseInstance
IResource
IConnectable
ISecretAttachmentTarget
IDBInstanceRef
IConstruct
IDependable
IEnvironmentAware
Inherited Members
DatabaseInstanceBase.FromDatabaseInstanceAttributes(Construct, string, IDatabaseInstanceAttributes)
DatabaseInstanceBase.FromLookup(Construct, string, IDatabaseInstanceLookupOptions)
DatabaseInstanceBase.AddProxy(string, IDatabaseProxyOptions)
DatabaseInstanceBase.AsSecretAttachmentTarget()
DatabaseInstanceBase.Metric(string, IMetricOptions)
DatabaseInstanceBase.MetricCPUUtilization(IMetricOptions)
DatabaseInstanceBase.MetricDatabaseConnections(IMetricOptions)
DatabaseInstanceBase.MetricFreeableMemory(IMetricOptions)
DatabaseInstanceBase.MetricFreeStorageSpace(IMetricOptions)
DatabaseInstanceBase.MetricReadIOPS(IMetricOptions)
DatabaseInstanceBase.MetricWriteIOPS(IMetricOptions)
DatabaseInstanceBase.OnEvent(string, IOnEventOptions)
DatabaseInstanceBase.DbInstanceRef
DatabaseInstanceBase.InstanceArn
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.With(params IMixin[])
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class DatabaseInstanceFromSnapshot : DatabaseInstanceBase, IDatabaseInstance, IResource, IConnectable, ISecretAttachmentTarget, IDBInstanceRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class DatabaseInstanceFromSnapshot Inherits DatabaseInstanceBase Implements IDatabaseInstance, IResource, IConnectable, ISecretAttachmentTarget, IDBInstanceRef, IConstruct, IDependable, IEnvironmentAware
Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

Examples
Vpc vpc;

             var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 });
             var myKey = new Key(this, "MyKey");

             new DatabaseInstanceFromSnapshot(this, "InstanceFromSnapshotWithCustomizedSecret", new DatabaseInstanceFromSnapshotProps {
                 Engine = engine,
                 Vpc = vpc,
                 SnapshotIdentifier = "mySnapshot",
                 Credentials = SnapshotCredentials.FromGeneratedSecret("username", new SnapshotCredentialsFromGeneratedPasswordOptions {
                     EncryptionKey = myKey,
                     ExcludeCharacters = "!&*^#@()",
                     ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
                 })
             });

Synopsis

Constructors

DatabaseInstanceFromSnapshot(Construct, string, IDatabaseInstanceFromSnapshotProps)

A database instance restored from a snapshot.

Properties

CloudwatchLogGroups

The log group is created when cloudwatchLogsExports is set.

Connections

Access to network connections.

DbInstanceEndpointAddress

The instance endpoint address.

DbInstanceEndpointPort

The instance endpoint port.

EnableIamAuthentication

A database instance restored from a snapshot.

Engine

The engine of this database Instance.

InstanceEndpoint

The instance endpoint.

InstanceIdentifier

The instance identifier.

InstanceResourceId

The AWS Region-unique, immutable identifier for the DB instance.

InstanceType

A database instance restored from a snapshot.

NewCfnProps

A database instance restored from a snapshot.

PROPERTY_INJECTION_ID

Uniquely identifies this class.

Secret

The AWS Secrets Manager secret attached to the instance.

SourceCfnProps

A database instance restored from a snapshot.

Vpc

The VPC where this database instance is deployed.

VpcPlacement

A database instance restored from a snapshot.

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.

GrantConnect(IGrantable, string?)

Grant the given identity connection access to the database.

SetLogRetention()

A database instance restored from a snapshot.

Constructors

DatabaseInstanceFromSnapshot(Construct, string, IDatabaseInstanceFromSnapshotProps)

A database instance restored from a snapshot.

public DatabaseInstanceFromSnapshot(Construct scope, string id, IDatabaseInstanceFromSnapshotProps props)
Parameters
scope Construct
id string
props IDatabaseInstanceFromSnapshotProps
Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

Examples
Vpc vpc;

             var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 });
             var myKey = new Key(this, "MyKey");

             new DatabaseInstanceFromSnapshot(this, "InstanceFromSnapshotWithCustomizedSecret", new DatabaseInstanceFromSnapshotProps {
                 Engine = engine,
                 Vpc = vpc,
                 SnapshotIdentifier = "mySnapshot",
                 Credentials = SnapshotCredentials.FromGeneratedSecret("username", new SnapshotCredentialsFromGeneratedPasswordOptions {
                     EncryptionKey = myKey,
                     ExcludeCharacters = "!&*^#@()",
                     ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
                 })
             });

Properties

CloudwatchLogGroups

The log group is created when cloudwatchLogsExports is set.

public virtual IDictionary<string, ILogGroup> CloudwatchLogGroups { get; }
Property Value

IDictionary<string, ILogGroup>

Remarks

Each export value will create a separate log group.

Connections

Access to network connections.

public override Connections_ Connections { get; }
Property Value

Connections_

Overrides
DatabaseInstanceBase.Connections
Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

DbInstanceEndpointAddress

The instance endpoint address.

public override string DbInstanceEndpointAddress { get; }
Property Value

string

Overrides
DatabaseInstanceBase.DbInstanceEndpointAddress
Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

DbInstanceEndpointPort

The instance endpoint port.

public override string DbInstanceEndpointPort { get; }
Property Value

string

Overrides
DatabaseInstanceBase.DbInstanceEndpointPort
Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

EnableIamAuthentication

A database instance restored from a snapshot.

protected override bool? EnableIamAuthentication { get; set; }
Property Value

bool?

Overrides
DatabaseInstanceBase.EnableIamAuthentication
Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

Engine

The engine of this database Instance.

public override IInstanceEngine? Engine { get; }
Property Value

IInstanceEngine

Overrides
DatabaseInstanceBase.Engine
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

Endpoint

Overrides
DatabaseInstanceBase.InstanceEndpoint
Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

InstanceIdentifier

The instance identifier.

public override string InstanceIdentifier { get; }
Property Value

string

Overrides
DatabaseInstanceBase.InstanceIdentifier
Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

InstanceResourceId

The AWS Region-unique, immutable identifier for the DB instance.

public override string? InstanceResourceId { get; }
Property Value

string

Overrides
DatabaseInstanceBase.InstanceResourceId
Remarks

This identifier is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB instance is accessed.

InstanceType

A database instance restored from a snapshot.

protected virtual InstanceType InstanceType { get; }
Property Value

InstanceType

Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

Examples
Vpc vpc;

             var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 });
             var myKey = new Key(this, "MyKey");

             new DatabaseInstanceFromSnapshot(this, "InstanceFromSnapshotWithCustomizedSecret", new DatabaseInstanceFromSnapshotProps {
                 Engine = engine,
                 Vpc = vpc,
                 SnapshotIdentifier = "mySnapshot",
                 Credentials = SnapshotCredentials.FromGeneratedSecret("username", new SnapshotCredentialsFromGeneratedPasswordOptions {
                     EncryptionKey = myKey,
                     ExcludeCharacters = "!&*^#@()",
                     ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
                 })
             });

NewCfnProps

A database instance restored from a snapshot.

protected virtual ICfnDBInstanceProps NewCfnProps { get; }
Property Value

ICfnDBInstanceProps

Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

Examples
Vpc vpc;

             var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 });
             var myKey = new Key(this, "MyKey");

             new DatabaseInstanceFromSnapshot(this, "InstanceFromSnapshotWithCustomizedSecret", new DatabaseInstanceFromSnapshotProps {
                 Engine = engine,
                 Vpc = vpc,
                 SnapshotIdentifier = "mySnapshot",
                 Credentials = SnapshotCredentials.FromGeneratedSecret("username", new SnapshotCredentialsFromGeneratedPasswordOptions {
                     EncryptionKey = myKey,
                     ExcludeCharacters = "!&*^#@()",
                     ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
                 })
             });

PROPERTY_INJECTION_ID

Uniquely identifies this class.

public static string PROPERTY_INJECTION_ID { get; }
Property Value

string

Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

Secret

The AWS Secrets Manager secret attached to the instance.

public virtual ISecret? Secret { get; }
Property Value

ISecret

Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

SourceCfnProps

A database instance restored from a snapshot.

protected virtual ICfnDBInstanceProps SourceCfnProps { get; }
Property Value

ICfnDBInstanceProps

Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

Examples
Vpc vpc;

             var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 });
             var myKey = new Key(this, "MyKey");

             new DatabaseInstanceFromSnapshot(this, "InstanceFromSnapshotWithCustomizedSecret", new DatabaseInstanceFromSnapshotProps {
                 Engine = engine,
                 Vpc = vpc,
                 SnapshotIdentifier = "mySnapshot",
                 Credentials = SnapshotCredentials.FromGeneratedSecret("username", new SnapshotCredentialsFromGeneratedPasswordOptions {
                     EncryptionKey = myKey,
                     ExcludeCharacters = "!&*^#@()",
                     ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
                 })
             });

Vpc

The VPC where this database instance is deployed.

public virtual IVpc Vpc { get; }
Property Value

IVpc

Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

VpcPlacement

A database instance restored from a snapshot.

protected virtual ISubnetSelection? VpcPlacement { get; }
Property Value

ISubnetSelection

Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

Examples
Vpc vpc;

             var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 });
             var myKey = new Key(this, "MyKey");

             new DatabaseInstanceFromSnapshot(this, "InstanceFromSnapshotWithCustomizedSecret", new DatabaseInstanceFromSnapshotProps {
                 Engine = engine,
                 Vpc = vpc,
                 SnapshotIdentifier = "mySnapshot",
                 Credentials = SnapshotCredentials.FromGeneratedSecret("username", new SnapshotCredentialsFromGeneratedPasswordOptions {
                     EncryptionKey = myKey,
                     ExcludeCharacters = "!&*^#@()",
                     ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
                 })
             });

Methods

AddRotationMultiUser(string, IRotationMultiUserOptions)

Adds the multi user rotation to this instance.

public virtual SecretRotation AddRotationMultiUser(string id, IRotationMultiUserOptions options)
Parameters
id string
options IRotationMultiUserOptions
Returns

SecretRotation

Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

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

SecretRotation

Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

GrantConnect(IGrantable, string?)

Grant the given identity connection access to the database.

public override Grant GrantConnect(IGrantable grantee, string? dbUser = null)
Parameters
grantee IGrantable

the Principal to grant the permissions to.

dbUser string

the name of the database user to allow connecting as to the db instance, or the default database user, obtained from the Secret, if not specified.

Returns

Grant

Overrides
DatabaseInstanceBase.GrantConnect(IGrantable, string?)
Remarks

[disable-awslint:no-grants]

SetLogRetention()

A database instance restored from a snapshot.

protected virtual void SetLogRetention()
Remarks

Resource: AWS::RDS::DBInstance

ExampleMetadata: infused

Examples
Vpc vpc;

             var engine = DatabaseInstanceEngine.Postgres(new PostgresInstanceEngineProps { Version = PostgresEngineVersion.VER_16_3 });
             var myKey = new Key(this, "MyKey");

             new DatabaseInstanceFromSnapshot(this, "InstanceFromSnapshotWithCustomizedSecret", new DatabaseInstanceFromSnapshotProps {
                 Engine = engine,
                 Vpc = vpc,
                 SnapshotIdentifier = "mySnapshot",
                 Credentials = SnapshotCredentials.FromGeneratedSecret("username", new SnapshotCredentialsFromGeneratedPasswordOptions {
                     EncryptionKey = myKey,
                     ExcludeCharacters = "!&*^#@()",
                     ReplicaRegions = new [] { new ReplicaRegion { Region = "eu-west-1" }, new ReplicaRegion { Region = "eu-west-2" } }
                 })
             });

Implements

IDatabaseInstance
IResource
IConnectable
ISecretAttachmentTarget
IDBInstanceRef
Constructs.IConstruct
Constructs.IDependable
IEnvironmentAware
Back to top Generated by DocFX