Back to course

Cloud Authentication (CLI Secrets)

Infrastructure as Code (Terraform & OpenTofu Mastery)

Don't Hardcode Keys!

To talk to AWS, you need credentials. Never put your Access Keys inside your .tf files. If you push them to GitHub, your account will be hacked in minutes.

The Correct Way: Environment Variables

Export your keys in the terminal: bash export AWS_ACCESS_KEY_ID="AKIA..." export AWS_SECRET_ACCESS_KEY="wJalr..."

OpenTofu will automatically look for these variables. This keeps your code clean and secure.