UNPKG

cdk-rds-sql

Version:

A CDK construct that allows creating roles and databases an on Aurora Serverless Postgresql cluster.

59 lines (58 loc) 1.59 kB
import * as kms from "aws-cdk-lib/aws-kms"; import { ISecret } from "aws-cdk-lib/aws-secretsmanager"; import { Construct } from "constructs"; import { IDatabase } from "./database"; import { Provider } from "./provider"; export interface RoleProps { /** * Provider. */ readonly provider: Provider; /** * SQL. */ readonly roleName: string; /** * Optional database this user is expected to use. * * If the database exists, connect privileges are granted. * * Specify none of `database` or `databaseName` or only one of them. * * @default no connection to any database is granted */ readonly database?: IDatabase; /** * Optional database name this user is expected to use. * * If the database exists, connect privileges are granted. * * Specify none of `database` or `databaseName` or only one of them. * * @default no connection to any database is granted */ readonly databaseName?: string; /** * A new secret is created for this user. * * Optionally encrypt it with the given key. */ readonly encryptionKey?: kms.IKey; /** * A new secret is created for this user. * * Optionally add secret name to the secret. */ readonly secretName?: string; } export declare class Role extends Construct { /** * The role name. */ readonly roleName: string; /** * The generated secret. */ readonly secret: ISecret; constructor(scope: Construct, id: string, props: RoleProps); }