import { Construct } from "constructs";
import * as ec2 from "aws-cdk-lib/aws-ec2";
import * as rds from "aws-cdk-lib/aws-rds";
import * as secretsManager from "aws-cdk-lib/aws-secretsmanager";
import { SSTConstruct } from "./Construct.js";
import { Function as Fn } from "./Function.js";
export interface RDSProps {
    /**
     * Database engine of the cluster. Cannot be changed once set.
     */
    engine: "mysql5.6" | "mysql5.7" | "postgresql10.14";
    /**
     * Name of a database which is automatically created inside the cluster.
     */
    defaultDatabaseName: string;
    scaling?: {
        /**
         * The time before the cluster is paused.
         *
         * Pass in true to pause after 5 minutes of inactive. And pass in false to
         * disable pausing.
         *
         * Or pass in the number of minutes to wait before the cluster is paused.
         *
         * @default true
         *
         * @example
         * ```js
         * new RDS(stack, "Database", {
         *   scaling: {
         *     autoPause: props.app.stage !== "prod"
         *   }
         * })
         * ```
         */
        autoPause?: boolean | number;
        /**
         * The minimum capacity for the cluster.
         *
         * @default "ACU_2"
         */
        minCapacity?: keyof typeof rds.AuroraCapacityUnit;
        /**
         * The maximum capacity for the cluster.
         *
         * @default "ACU_16"
         */
        maxCapacity?: keyof typeof rds.AuroraCapacityUnit;
    };
    /**
     * Path to the directory that contains the migration scripts. The `RDS` construct uses [Kysely](https://koskimas.github.io/kysely/) to run and manage schema migrations. The `migrations` prop should point to the folder where your migration files are.
     *
     * @example
     *
     * ```js
     * new RDS(stack, "Database", {
     *   engine: "postgresql10.14",
     *   defaultDatabaseName: "acme",
     *   migrations: "path/to/migration/scripts",
     * });
     * ```
     */
    migrations?: string;
    /**
     * Path to place generated typescript types after running migrations
     *
     * @example
     *
     * ```js
     * new RDS(stack, "Database", {
     *   engine: "postgresql10.14",
     *   defaultDatabaseName: "acme",
     *   migrations: "path/to/migration/scripts",
     *   types: "backend/core/sql/types.ts",
     * });
     * ```
     */
    types?: string;
    cdk?: {
        /**
         * Configure the internallly created RDS cluster.
         *
         * @example
         * ```js
         * new RDS(stack, "Database", {
         *   cdk: {
         *     cluster: {
         *       clusterIdentifier: "my-cluster",
         *     }
         *   },
         * });
         * ```
         *
         * Alternatively, you can import an existing RDS Serverless v1 Cluster in your AWS account.
         *
         * @example
         * ```js
         * new RDS(stack, "Database", {
         *   cdk: {
         *     cluster: rds.ServerlessCluster.fromServerlessClusterAttributes(stack, "ICluster", {
         *       clusterIdentifier: "my-cluster",
         *     }),
         *     secret: secretsManager.Secret.fromSecretAttributes(stack, "ISecret", {
         *       secretPartialArn: "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret",
         *     }),
         *   },
         * });
         * ```
         */
        cluster?: rds.IServerlessCluster | RDSCdkServerlessClusterProps;
        /**
         * Required when importing existing RDS Serverless v1 Cluster.
         */
        secret?: secretsManager.ISecret;
    };
}
export declare type RDSEngineType = "mysql5.6" | "mysql5.7" | "postgresql10.14";
export interface RDSCdkServerlessClusterProps extends Omit<rds.ServerlessClusterProps, "vpc" | "engine" | "defaultDatabaseName" | "scaling"> {
    vpc?: ec2.IVpc;
}
/**
 * The `RDS` construct is a higher level CDK construct that makes it easy to create an [RDS Serverless Cluster](https://aws.amazon.com/rds/).
 *
 * @example
 * ### Using the minimal config
 *
 * Deploys an auto-scaling PostgreSQL database.
 *
 * ```js
 * import { RDS } from "@serverless-stack/resources";
 *
 * new RDS(stack, "Database", {
 *   engine: "postgresql10.14",
 *   defaultDatabaseName: "my_database",
 * });
 * ```
 *
 */
export declare class RDS extends Construct implements SSTConstruct {
    readonly cdk: {
        /**
         * The ARN of the internally created CDK ServerlessCluster instance.
         */
        cluster: rds.ServerlessCluster;
    };
    /**
     * The ARN of the internally created CDK ServerlessCluster instance.
     */
    migratorFunction?: Fn;
    private props;
    private secret;
    constructor(scope: Construct, id: string, props: RDSProps);
    /**
     * The ARN of the internally created RDS Serverless Cluster.
     */
    get clusterArn(): string;
    /**
     * The ARN of the internally created RDS Serverless Cluster.
     */
    get clusterIdentifier(): string;
    /**
     * The ARN of the internally created RDS Serverless Cluster.
     */
    get clusterEndpoint(): rds.Endpoint;
    /**
     * The default database name of the RDS Serverless Cluster.
     */
    get defaultDatabaseName(): string;
    /**
     * The ARN of the internally created Secrets Manager Secret.
     */
    get secretArn(): string;
    getConstructMetadata(): {
        type: "RDS";
        data: {
            engine: "mysql5.6" | "mysql5.7" | "postgresql10.14";
            secretArn: string;
            types: string | undefined;
            clusterArn: string;
            clusterIdentifier: string;
            defaultDatabaseName: string;
            migrator: {
                node: string;
                stack: string;
            } | undefined;
        };
    };
    private validateRequiredProps;
    private validateCDKPropWhenIsConstruct;
    private validateCDKPropWhenIsClusterProps;
    private validateMigrationsFileExists;
    private getEngine;
    private getScaling;
    private getVpc;
    private getVpcSubnets;
    private createCluster;
    private importCluster;
    private createMigrationsFunction;
    private createMigrationCustomResource;
    private generateMigrationsHash;
}
