Create a .env file with your credentials:
# Create .env file
echo 'AWS_ACCESS_KEY_ID=your_new_access_key_here' > .env.aws
echo 'AWS_SECRET_ACCESS_KEY=your_new_secret_key_here' >> .env.aws
echo 'AWS_DEFAULT_REGION=ap-southeast-2' >> .env.awsThen load them:
# Load environment variables
Get-Content .env.aws | ForEach {
$parts = $_.Split('=')
[System.Environment]::SetEnvironmentVariable($parts[0], $parts[1], "User")
}Edit AWS config files directly:
Windows locations:
%USERPROFILE%\.aws\credentials%USERPROFILE%\.aws\config
Credentials file content:
[default]
aws_access_key_id = YOUR_NEW_ACCESS_KEY
aws_secret_access_key = YOUR_NEW_SECRET_KEYConfig file content:
[default]
region = ap-southeast-2
output = json# Create temporary input file
@'
YOUR_NEW_ACCESS_KEY
YOUR_NEW_SECRET_KEY
ap-southeast-2
json
'@ | .\.venv\Scripts\python.exe -m awscli configure-
Test credentials:
.\.venv\Scripts\python.exe -m awscli sts get-caller-identity
-
Test App Runner access:
.\.venv\Scripts\python.exe -m awscli apprunner list-services --region ap-southeast-2
-
Continue with App Runner service creation
- Never paste credentials in chat/terminal logs
- Use temporary credentials when possible
- Rotate keys regularly
- Delete unused access keys immediately
- Use least privilege policies
Make sure to update GitHub Secrets with the new credentials:
- Repository Settings β Secrets and Variables β Actions
- Update
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY