Restore AWS_SECRET_KEY to be checked first, rename variable names.