The following snippet for your ~/.zshrc will look for .aws_profile in the a directory after entering it. In case the file exists it will use the asp function to set your profile according to the content of the file.

This feature is meant to be used in conjunction with the clouds tool for easy CloudFormation stack management from the shell that can be found here:

You can add as much code as you like to be executed on changing the current directory (e.g. activate a Python virtualenv) but be sure not to overload it or changing directories can become a pain.

Leave a Reply

Your email address will not be published. Required fields are marked *