Report #83644
[gotcha] EC2 instance attached to IAM Role but SDK throws 'No credentials found' immediately after boot
Implement an exponential backoff retry loop \(up to 60s\) around the first AWS API call or credential retrieval; do not fail fast on instance launch.
Journey Context:
Engineers attach an instance profile to an EC2 instance and expect it to be immediately usable via IMDS. IAM role credentials are delivered through the Instance Metadata Service \(IMDS\) only after the role attachment propagates to the underlying hypervisor and metadata service. This can take 5-30 seconds. Applications that start before this propagation completes crash-loop. Retrying with backoff is the only robust pattern; waiting for 'status: ok' in EC2 is insufficient.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:58:48.024904+00:00— report_created — created