oscerd opened a new pull request, #26674: URL: https://github.com/apache/camel/pull/26674
## What Adds an opt-in `useAutoDetectCredentialsProvider` option that detects the runtime environment an AWS component runs in and selects the matching AWS credentials provider — as a **pilot on `camel-aws2-s3`**. The core is a new shared `AwsRuntimeCredentialsResolver` in `camel-aws-common`, invoked from the existing central `AwsClientBuilderUtil.resolveCredentialsProvider` selector, so it can be rolled out to the other aws2 components with a one-line field addition each. ## Why The SDK's `DefaultCredentialsProvider` walks its chain (env → sysprops → web-identity → profile → container → IMDS) with **IMDS last**. Off-EC2 (local dev, non-AWS containers) this can hang on the IMDS metadata timeout, and the chain never reports which source it used. ## Behaviour - Detection order **mirrors the SDK chain exactly**, so the selected source never differs from the SDK. - The environment is probed **explicitly** (short-timeout IMDS reachability check), so off-EC2 workloads holding real credentials (env / profile / container) resolve without waiting on the IMDS lookup. - The detected source is **logged at INFO**. - The detected provider is the head of a chain whose tail is the full `DefaultCredentialsProvider`, so a detected-but-unusable source falls back to the SDK chain (never worse than today). - Web identity / IRSA delegates to the SDK provider (it needs `software.amazon.awssdk:sts`, which `camel-aws-common` doesn't carry) — avoids a resolve-time regression. - **Backwards compatible & opt-in:** the `AwsCommonConfiguration` interface method defaults to `false`; nothing changes unless `useAutoDetectCredentialsProvider=true`. ## Scope - Pilot on `camel-aws2-s3`. Rolling out to the remaining SDK-v2 components is a mechanical follow-up (add the `@UriParam` field per config class). - STS explicit assume-role and non-AWS clouds are out of scope for v1. ## Tests `AwsRuntimeCredentialsResolverTest` (13 cases) covers every detection branch, the SDK-order precedence (profile before container, env before profile), and the `resolve()` provider mapping, using an injectable in-memory environment (no real env vars, files, or sockets). ## Notes Draft while CI validates the generated catalog / endpoint-DSL sources (CI regenerates the full catalog under its `full` profile). JIRA: https://issues.apache.org/jira/browse/CAMEL-24870 --- _Claude Code on behalf of oscerd_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
