@finnairoyj/cdk-constructs-lib
    Preparing search index...

    Interface RdsDatabaseInstanceProps

    interface RdsDatabaseInstanceProps {
        adminCredentials?: ISecret;
        allocatedStorage: number;
        allowMajorVersionUpgrade?: boolean;
        autoMinorVersionUpgrade?: boolean;
        backupRetention?: Duration;
        cloudwatchLogsRetention?: RetentionDays;
        createClientAccessSecurityGroup?: boolean;
        dbEngine: DatabaseEngine;
        dbEngineVersion: DbEngineVersion;
        dbInstanceName: string;
        deletionProtection?: boolean;
        environment: "dev" | "test" | "preprod" | "prod" | "tools" | "sandbox";
        iamAuthentication?: boolean;
        instanceClass: InstanceClass;
        instanceSize: InstanceSize;
        kmsEnvironmentKey?: IKey;
        kmsSecretsKey?: IKey;
        kmsStorageEncryptionKey?: IKey;
        logRetentionRole?: IRole;
        maxAllocatedStorage: number;
        multiAz?: boolean;
        port?: number;
        privateHostedZone?: IPrivateHostedZone;
        snapshotId?: string;
        vpc?: IVpc;
        vpcSubnets?: SubnetSelection;
    }
    Index

    Properties

    adminCredentials?: ISecret

    Admin credentials for the database. Must be in JSON format for RDS

    - New SecretsManager secret is created for admin credentials
    
    allocatedStorage: number

    Allocated DB storage size in gibibytes (GiB). Must be 20 or greater

    allowMajorVersionUpgrade?: boolean

    Allow RDS to automatically perform major DB engine version updates during defined service window

    false
    
    autoMinorVersionUpgrade?: boolean

    Allow RDS to automatically perform minor DB engine version updates and patches during defined service window

    true
    
    backupRetention?: Duration

    The number of days during which automatic DB snapshots are retained. Set to zero to disable backups. When creating a read replica, you must enable automatic backups on the source database instance by setting the backup retention to a value other than zero.

    - Duration.days(1)
    
    cloudwatchLogsRetention?: RetentionDays

    Retention period for database CloudWatch logs

    RetentionDays.SIX_MONTHS
    
    createClientAccessSecurityGroup?: boolean

    Create an empty SecurityGroup that allows access to the database instance from external instances that have the client access security group associated.

    Note that the preferred way of granting access to the database is to use the CDK connections API to grant access to the DB default security group from the client instance's security group. This method follows the leas-access principle and creates point-to-point openings from client to the database

    false No ClientAccessSecurityGroup is created
    
    dbEngine: DatabaseEngine

    DB engine type

    dbEngineVersion: DbEngineVersion

    Database engine version. Use value from PostgresEngineVersion for 'postgres' DB engine and value from MysqlEngineVersion for 'mysql' DB engine

    It is recommended to specify the DB major version only when 'autoMinorVersionUpgrade' is enabled (default). Specifying exact minor version in this case will cause stack drift when the minor version is automatically updated by RDS. When specifying only the major version, RDS will use the latest minor version available when launching the DB instance

    dbInstanceName: string

    Unique name for the DB instance

    deletionProtection?: boolean

    Protect the DB instance from accidental deletion. Should only be disabled when intentionally deleting the DB instance

    true
    
    environment: "dev" | "test" | "preprod" | "prod" | "tools" | "sandbox"

    Infra environment

    iamAuthentication?: boolean

    Enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts

    false
    
    instanceClass: InstanceClass

    DB instance class to use

    instanceSize: InstanceSize

    DB instance size to use

    kmsEnvironmentKey?: IKey

    KMS key to be used to encrypt performance insights data

    kmsSecretsKey?: IKey

    KMS key to be used to encrypt the DB admin password secret

    Required if 'adminCredentials' secret is not provided

    kmsStorageEncryptionKey?: IKey

    KMS key to be used for DB storage encryption

    Required if 'snapshotId' is not provided. For snapshots, the KMS key used to encrypt the snapshot is used to encrypt the new DB instance storage

    logRetentionRole?: IRole

    Shared CloudWatch log retention role that CDK-generated Lambda uses to set retention period for the DB CloudWatch log groups. Using a shared role reduces number of redundant resources

    maxAllocatedStorage: number

    Maximum allocated storage in gibibytes (GiB) for storage autoscaling. Storage will not be extended beyond this size

    multiAz?: boolean

    Enable multi-AZ standby instance deployment for the DB instance. Highly recommended for PROD environments for high availability (HA). Should not be used in other environments to reduce costs from the standby instance

    false
    
    port?: number

    Custom port for the database

    5432 for 'postgres' engine, 3306 for 'mysql' engine
    
    privateHostedZone?: IPrivateHostedZone

    Private HostedZone to create the DNS alias record for the RDS instance to.

    The created alias record is of the format <kebab-case(dbInstanceName)>. Example: my-db-instance.privatezonename.internal

    No DNS alias is created
    
    snapshotId?: string

    ID or ARN of the database snapshot to create the instance from

    Providing a snapshotId will trigger replacement of existing RDS instance. If restoring a snapshot it is recommended to create a separate instance of this construct, not to update existing one

    NOTE: When restoring a DB from a snapshot, please refer to the AWS documentation! Potential risk of data loss exists. After restoring a DB from snapshot, the 'snapshotId' property cannot be changed or removed. This will result in CloudFormation replacing the DB instance

    vpc?: IVpc

    VPC to use for the DB instance

    - Use the LandingZone managed VPC on the current account
    
    vpcSubnets?: SubnetSelection

    Subnets to use for the VPC. Minimum set of 2 subnets needs to be defined

    - Use the RESTRICTED subnets in the LandingZone managed VPC on the current account