The Python script , AWS Lambda function and AWS CloudFormation templates described queries Amazon DynamoDB table with the inputs from AWS CloudFormation to lookup the mappings.
For more details refer the blog here
To prevent any problems with your system Python version conflicting with the application, virtualenv can be used.
Install Python:
pip install python 2.7
Install virtualenv:
$ pip install virtualenv
$ virtualenv -p PATH_TO_YOUR_PYTHON_2.7 venv2
$ virtualenv ~/.virtualenvs/venv2
$ source ~/.virtualenvs/venv2/bin/activate
$ pip install awscli