Configuration from AWS

Use SSM, Secrets Manager, AppConfig Data or S3 to supply application properties or stored credentials. Start with the task you need, then follow the corresponding service guide to select resources and grant AWS permissions.

Choose what you want to configure

Your goal Use What to expect

Load a set of application properties

ConfigSource

Values are available at startup; supported providers can refresh them periodically

Read one remote value or a JSON field

${sm::…​} / ${ssm::…​} expressions

Assign the result to a local property; successful reads are cached for five minutes by default

Connect a datasource using stored credentials

Quarkus CredentialsProvider

New physical connections can use freshly retrieved credentials; existing connections are not replaced automatically

Choose a provider

Capability SSM Parameter Store Secrets Manager AppConfig Data S3

Load properties from

Parameter names or hierarchies

Explicit secret names/ARNs

Deployed application/environment/configuration profiles

Explicit bucket/key selections, optionally pinned to a version

Default format selection

JSON objects/arrays, otherwise raw text under the parameter key

JSON objects/arrays, otherwise raw text under the target prefix

JSON objects/arrays, then YAML Content-Type, otherwise Java properties

Recognized Content-Type, then key extension

Refresh properties

Optional polling

Optional polling

Optional polling, subject to AWS minimum intervals

Optional polling for current objects; pinned versions do not follow updates

Read individual values

${ssm::name}, including version/label selectors

${sm::secret-id}, reading AWSCURRENT

Not provided

Not provided

Supply stored credentials

ssm-credentials-provider

secretsmanager-credentials-provider

Not provided

Not provided

Choose SSM for parameter hierarchies, SSM or Secrets Manager for stored credentials, AppConfig Data for deployed configuration profiles, and S3 for configuration files. The service guides provide the exact selection properties and IAM actions.

Load application properties

For example, load a greeting from SSM:

  1. Add io.quarkiverse.amazonservices:quarkus-amazon-ssm to your application.

  2. Create parameter /myapp/prod/greeting with value Hello from AWS and configure access to AWS.

  3. Add the following to application.properties:

quarkus.ssm.config.enabled=true
quarkus.ssm.config.path=/myapp/prod/

Inject the resulting property in a CDI bean:

@Inject
@ConfigProperty(name = "greeting")
String greeting;

greeting contains Hello from AWS. SSM removes the selected path from the property name. For documents, multiple selections or another provider, follow the service examples. These values can configure runtime properties, not build-time settings or the AWS connection used to load them.

Read an individual secret or parameter

With the Secrets Manager extension installed and AWS access configured, create:

  • Secret prod/api-key containing example-key.

  • Secret prod/database containing {"username":"app_user","password":"database-password"}.

Assign the remote values to local application properties:

myapp.api-key=${sm::prod/api-key}
myapp.database.password=${sm::prod/database#/password}

Reading myapp.api-key returns example-key; reading myapp.database.password returns database-password. You do not need to enable the Secrets Manager ConfigSource. Use ${ssm::/parameter/name} for SSM instead. Unused expressions do not make AWS requests. Keep a local property name such as myapp.api-key so you can override it per profile or environment.

Without #/..., the entire remote text is returned unchanged. Use a JSON Pointer such as #/users/0/password to select a string, number or boolean. Following JSON Pointer (RFC 6901), escape / in a key as ~1 and ~ as ~0: #/a~1b selects the key a/b. Missing keys, JSON null, objects, arrays and invalid JSON fail resolution. Returned text is not expanded as another expression.

To fetch on every resolution instead of using the default five-minute cache:

quarkus.secretsmanager.expression.cache-ttl=0S
# For SSM expressions, use quarkus.ssm.expression.cache-ttl

Use dynamic lookups for later reads; disabling the cache does not update an already injected String. With caching enabled, a lookup can reuse an older value until its cache entry expires. The cache holds at most 256 resources; using more can cause earlier re-fetches. Use consistent resource names/ARNs to avoid redundant reads. A failed resolution throws an error rather than returning an expired cached value; a later lookup can retry. config.fail-on-missing-config=false does not suppress expression errors. Expressions cannot supply build-time settings or the AWS connection settings needed to resolve them. Resolving a value that is not cached waits for an AWS response.

Read updated values

Polling is off by default. To refresh the SSM greeting above, add:

quarkus.ssm.config.update-interval=30S

Read the property through Provider<T> rather than keeping an injected String:

@Inject
@ConfigProperty(name = "greeting")
Provider<String> greeting;

String message() {
    return greeting.get();
}

Use jakarta.inject.Inject, jakarta.inject.Provider and org.eclipse.microprofile.config.inject.ConfigProperty. After changing the parameter and a successful refresh, message() returns the new value. An injected String or an existing @ConfigMapping keeps its initial value. Alternatively, call ConfigProvider.getConfig().getValue("greeting", String.class).

Polling waits at least the configured interval after each completed read. AppConfig may impose a longer delay; follow its polling settings. For Secrets Manager or S3, set config.update-interval under the corresponding service prefix instead. Refreshing properties does not restart the application, reconfigure existing consumers or recycle connection pools.

Choose startup and refresh behavior

By default, a missing resource, denied access, invalid content or incomplete initial load prevents startup. To make the SSM source optional and provide a local fallback:

quarkus.ssm.config.fail-on-missing-config=false
greeting=Hello locally

If the initial load fails, no remote properties from that source are used and greeting resolves to Hello locally. When loading succeeds, remote values take precedence over application.properties by default, but not environment variables or system properties. Adjust quarkus.ssm.config.ordinal (default 270) to change that precedence; other providers use the corresponding service prefix. Invalid AWS connection settings still prevent startup.

  • A refresh failure leaves all previously loaded values from that source available; partial updates are not exposed.

  • Give entries distinct property names or prefixes. Duplicate keys within one source fail even when their values match. Separate sources use normal configuration precedence.

  • Deleting an explicitly selected resource causes a load failure rather than removing its properties. Parameters removed from an SSM path behave differently; see SSM polling.

  • Store related values in one document if they must come from the same version. Neither multiple reads nor batch APIs guarantee a consistent version across different resources.

Choose document formats and property names

Use UTF-8 content. Set format=json, properties, yaml or raw when you want an explicit interpretation instead of the defaults in the provider table. Each provider uses config.format as the default for its entries; entries.<name>.format overrides it, including an explicit auto override. For YAML, add io.quarkus:quarkus-config-yaml; selecting YAML without it fails.

JSON/YAML documents expose nested keys with dots and arrays with indices. For example, {"database":{"hosts":["db.example.com"]}} with prefix myapp exposes myapp.database.hosts[0]=db.example.com. An entry name is not a prefix: configure prefix explicitly if needed. Properties documents expose their decoded keys. Use a non-empty target name/prefix for raw text or non-null JSON scalars. raw preserves the entire value without trimming; explicit JSON omits nulls and empty objects/arrays.

With SSM/Secrets Manager auto and a target key, malformed or empty JSON objects/arrays are returned as raw text; JSON scalars keep their quotes and spaces. Without a target, non-empty raw or malformed content is rejected. Set an explicit format for properties or YAML documents: neither provider detects them automatically.

Connect a datasource using stored credentials

Add io.quarkiverse.amazonservices:quarkus-amazon-secretsmanager and your Quarkus JDBC driver, for example io.quarkus:quarkus-jdbc-postgresql. Configure AWS access and store {"username":"app_user","password":"database-password"} in secret prod/database.

quarkus.secretsmanager.credentials-provider.db.secret-id=prod/database

quarkus.datasource.db-kind=postgresql
quarkus.datasource.jdbc.url=jdbc:postgresql://database.example.com:5432/myapp
quarkus.datasource.credentials-provider=db
quarkus.datasource.credentials-provider-name=secretsmanager-credentials-provider

Replace the example JDBC URL with your database’s URL. New physical connections authenticate as app_user with database-password, provided the database accepts those credentials. Each request for credentials reads the store again; existing connections keep their original authentication. See connection recycling when configuring rotation.

db selects the credential set. Always set credentials-provider-name, even when only one provider is installed. No config.enabled setting is required, and installing this extension does not replace an existing default provider. For SSM, use the SSM datasource settings. To generate an RDS IAM token instead of reading a stored password, use RDS IAM credentials.

Select credential fields or password-only values

Choose one mode per credential set:

  • A document (secret-id or parameter-name): use json (default), properties, yaml or raw. Select the password with password-key (default password) and the optional username with username-key (default username). For JSON these are literal top-level field names; for properties/YAML they are decoded keys. Selected values must be non-empty strings. An absent username is omitted; username-key= explicitly disables it. Extra fields are ignored. auto and JSON Pointer selection are not supported for credentials. YAML needs the YAML extension.

  • Individual raw values: select secrets.password / secrets.user for Secrets Manager or parameters.password / parameters.user for SSM, instead of selecting a document. password is required and user is optional. Document field selectors do not decode these values.

For password-only rotation, select a password-only document with format=raw and keep the username local:

quarkus.datasource.username=app_user
quarkus.secretsmanager.credentials-provider.db.secret-id=prod/database-password
quarkus.secretsmanager.credentials-provider.db.format=raw

The datasource uses app_user and the entire secret text as its password. For separate values and optional batching, follow the Secrets Manager or SSM examples. Their credentials-provider.<name>.batch-retrieval flags default to false and are independent of ConfigSource batching and expression cache settings.

Recycle connections when credentials rotate

Configure a connection lifetime suitable for your database’s rotation/overlap policy. For example:

# Illustrative only; choose a value appropriate for your rotation policy
quarkus.datasource.jdbc.max-lifetime=30M

Agroal requests credentials for new physical connections, not on every pool borrow. Checked-out connections can outlive the configured lifetime until returned. Updating a secret/parameter does not change the database password for you; coordinate both updates and allow for propagation and transient failures. There is no guarantee of uninterrupted rotation. Credential reads fail rather than falling back to previously returned credentials. No expiration timestamp is supplied; consumers such as RabbitMQ that rely on it need their own reconnect policy.

Configure access to AWS

For ConfigSources and expressions, use the default service’s AWS settings, not named-client settings. For example:

quarkus.ssm.aws.region=eu-west-1
quarkus.ssm.api-call-timeout=10S
quarkus.ssm.api-call-attempt-timeout=3S
quarkus.ssm.sync-client.connection-timeout=2S
quarkus.ssm.sync-client.socket-timeout=3S

Use the application’s AWS credentials provider chain or configure another supported aws.credentials.type. Grant access only to the selected resources, plus KMS decrypt permissions where needed; the service guides list the IAM actions. For a local emulator or a custom endpoint, also set the service’s endpoint-override. For another service, replace quarkus.ssm with its prefix.

ConfigSources and expressions do not support aws.credentials.type=custom (CDI-provided credentials). Configure their AWS access without depending on values they must load. Their reads always use the bundled URL Connection transport: connection/socket timeouts and sync-client.tls-* settings apply, while sync-client.type and Apache/CRT-specific options do not. Configured execution interceptors and extension telemetry are not applied to these reads. Expressions default to a 10-second call timeout and a 3-second attempt timeout when those settings are absent. For S3 body downloads, also bound idle reads with the socket timeout.

Stored-credential providers use the default service client’s usual credentials, transport, interceptor and telemetry settings. These AWS credentials authenticate access to the store; they are distinct from the stored username/password used by your datasource.