Comment by scarface_74
Comment by scarface_74 21 hours ago
Why are AWS keys anywhere near your code in the first place?
For instance in Python, you initialize an object using
boto3.client(“s3”)
When you use IAM identity center, you get temporary access keys which you assign to environment variables and the keys are automatically picked up.Even if you use “aws configure” and have long lasting keys (don’t do that), your keys will be stored in your home directory, nowhere near your repository and still usable locally.
When running your code on AWS, whatever you are using to run it on will get permission from the IAM role attached to the Lambda, EC2, etc.
It tends to happen more on front end I think, especially since it's in the tutorial and many haven't been given the training on what to do better. Not really AWS, but even the trained ones will put it in a .local.properties file or something and then forget to add it to gitignore