While for the other secrets, I’ve got nothing, there is never a reason to have AWS secret keys in your code or in application specific configuration files.
Every AWS SDK will automatically read your keys from your config file in your home directory locally. Just run
aws configure
When you run your code on EC2, Lambda or ECS, the same SDK’s will automatically get the keys associated with the attached role.