page:guides:spring boot:configuration secrets

Configure environment and secrets for Spring Boot

Configuration and secrets for a Spring Boot app on Ample. Verified on Spring Boot: an --env value delivered encrypted and reported as present without being echoed (secret=set). Build and start: ./mvnw -q -DskipTests package (or the Gradle wrapper) producing one application jar, then java -jar on the jvm-21 template (Temurin JDK 21) with server.port read from PORT.

Prerequisites

Workflow Steps

Build and start

./mvnw -q -DskipTests package (or the Gradle wrapper) producing one application jar, then java -jar on the jvm-21 template (Temurin JDK 21) with server.port read from PORT; the server must bind 0.0.0.0 on PORT.

Pass values on deploy

Use --env KEY=value (repeatable) or --env-file; values are encrypted at rest and reused on redeploys. Declare names only in ample.toml.

Command: ample deploy . --name --public --env MY_SECRET=...

Verify

Fetch the live URL and /p/configuration-secrets on the example; on failure read the build and runtime logs.

Command: ample logs --kind build

Examples

Spring Boot pattern fixture

Verified configuration and secrets on Spring Boot.

Source Reference: tests/deploy-canaries/spring-boot-patterns

Success Checks

Limitations

Cost Estimate

Components

Note: Always-on monthly price of the tested sizes; apps auto-pause when idle. Buckets are allocation-priced per quota and not included.

Evidence Summary

Unknowns

Formats