Skip to content
AWS docs0.4

AWS Exposed Database Integration

Latest stable Based on AWS release 0.4.0

Library manual grounded in the 0.4.0 release source.

Resolves AWS-backed database settings, creates Hikari data sources and Exposed databases, and manages default or named database handles.

Use it when JDBC connection settings or credentials come from Secrets Manager, Parameter Store, or RDS IAM authentication.

Applications select one central BOM version.

dependencies {
implementation(platform("io.github.bluetape4k:bluetape4k-dependencies:<version>"))
implementation("io.github.bluetape4k.aws:bluetape4k-aws-exposed")
}

AWS service SDKs follow a compileOnly policy; add the services actually used as runtime dependencies.

A config source identifies where settings live; a resolver returns concrete properties; the data-source factory creates Hikari; the database factory connects Exposed and returns a closeable handle.

val factory = AwsExposedDatabaseFactory(resolver, dataSourceFactory)
val handle = factory.create("orders", properties)
try {
transaction(handle.database) { Orders.selectAll().count() }
} finally {
handle.close()
}

AwsDatabaseProperties, AwsDatabaseSettingsResolver, AwsJdbcDataSourceFactory, AwsExposedDatabaseFactory, AwsExposedDatabaseRegistry, and RDS IAM authentication support.

Put client and background-job ownership at one application boundary. Configure region, credentials, and endpoints once instead of rebuilding them per call.

Spring Boot auto-configuration and Ktor’s Exposed plugin consume this foundation. Add the required Secrets Manager, SSM, RDS, JDBC driver, Hikari, and Exposed runtime modules.

Keep secrets out of static configuration. Configure source, region, secret/parameter identifier, JDBC driver and URL shape, pool size, and IAM token refresh behavior.

Malformed secret payloads, missing driver jars, expired IAM tokens, wrong region, and pool ownership mistakes surface during resolution or first connection.

Resolve settings before serving traffic, bound pool size, rotate credentials outside transactions, and close every handle during application shutdown.

Use fake resolvers for unit tests and an emulator or disposable database for resolution-plus-connection tests. Assert that close releases Hikari resources.

Follow database-settings, rds-iam-and-hikari, and transaction-boundaries, then run the Spring Boot and Ktor Exposed examples.

This module resolves and owns infrastructure; it does not design Exposed tables or move blocking JDBC work off coroutine threads automatically.

These diagrams are loaded directly from README assets published with the 0.4.0 release and pinned to its immutable commit. They describe this manual’s released structure and runtime flows, not later Snapshot changes. Select a preview to open the SVG at the same release commit.

AWS Exposed architecture diagram

Release README: aws-exposed/README.md

AWS Exposed configuration flow diagram

Release README: aws-exposed/README.md

AWS Exposed database handle sequence diagram

Section titled “AWS Exposed database handle sequence diagram”

AWS Exposed database handle sequence diagram

Release README: aws-exposed/README.md