If you're in AWS, you get credentials from the metadata service.
If you're outside AWS, workloads assume roles using OIDC. If you still have access keys, generally speaking, you're doing it wrong.
https://aws.amazon.com/blogs/security/access-aws-using-a-goo...