├── .gitignore ├── License.txt ├── README.md ├── a2a ├── __init__.py └── runner.py ├── setup.cfg └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | 132 | # Intellij 133 | .idea/ -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | Copyright (c) 2020 Kshitij Sharma 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in all 10 | copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 17 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## A2A 2 | 3 | 4 | [![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger) 5 | 6 | A2A(Azure to AWS or AWS to Azure) is a cli tool that provides you service mappings for the most of the cloud offerings across the platforms. 7 | 8 | As a DevOps/SRE engineer who works multi-cloud, this handy tool gives the correct service mappings between Azure and AWS. 9 | This can be pretty useful who is new to any of the clouds or coming from experience with a specific cloud . 10 | 11 | # Features! 12 | 13 | - Enter the service name and voila the corresponding service in the appropriate cloud platform is shown 14 | - Service name can be from any platform(AWS/Azure) 15 | - Don't need to go to https://docs.microsoft.com/en-us/azure/architecture/aws-professional/services everytime to check for mappings 16 | 17 | ### Tech 18 | 19 | A2A uses a number of open source projects to work properly: 20 | 21 | * [Python] - Oh surprise! 22 | * [Scrappy] - Python based scraping utility 23 | 24 | 25 | ### Installation 26 | 27 | ```sh 28 | $ pip install a2a 29 | ``` 30 | 31 | ## Usage 32 | 33 | ```sh 34 | $ a2a "Firewall" 35 | SERVICE URL CORRESPONDING SERVICES CORRESPONDING URLS 36 | ------------ -------------------------------------------------------- ---------------------------- ------------------------------- 37 | ['Firewall'] ['https://azure.microsoft.com/services/azure-firewall/'] ['Web Application Firewall'] ['https://aws.amazon.com/waf/'] 38 | 39 | $ a2a "Codebuild" 40 | SERVICE URL CORRESPONDING SERVICES CORRESPONDING URLS 41 | ------------- ------------------------------------- ------------------------ ------------------------------------------------ 42 | ['CodeBuild'] ['https://aws.amazon.com/codebuild/'] ['DevOps'] ['https://azure.microsoft.com/services/devops/'] 43 | ``` 44 | 45 | ### Development 46 | 47 | Want to contribute? Great! Feel free to open an PR. 48 | 49 | ### Todos 50 | 51 | - Write Tests 52 | - Add Support for GCP ( https://cloud.google.com/docs/compare/azure ) 53 | 54 | License 55 | ---- 56 | 57 | MIT 58 | 59 | 60 | **Free Software, Hell Yeah!** 61 | -------------------------------------------------------------------------------- /a2a/__init__.py: -------------------------------------------------------------------------------- 1 | from a2a.runner import GithubSpider -------------------------------------------------------------------------------- /a2a/runner.py: -------------------------------------------------------------------------------- 1 | 2 | import argparse 3 | import scrapy 4 | from scrapy.crawler import CrawlerProcess 5 | from tabulate import tabulate 6 | import logging 7 | 8 | 9 | class GithubSpider(scrapy.Spider): 10 | service = 'default' 11 | name = 'github' 12 | start_urls = ['https://github.com/MicrosoftDocs/architecture-center/blob/master/docs/aws-professional/services.md'] 13 | 14 | def parse(self, response): 15 | tables = response.css('table') 16 | for table in tables: 17 | rows = table.xpath('//tr//td') 18 | for index, row in enumerate(rows): 19 | keywords = row.xpath('a//node()').extract() 20 | url = row.xpath('a/@href').extract() 21 | if self.service.lower() in (keyword.lower() for keyword in keywords): 22 | matched_service = rows[index + 1].xpath('a//node()').extract() if rows[index + 1].xpath( 23 | 'a//node()').extract() else rows[index - 1].xpath('a//node()').extract() 24 | matched_url = rows[index + 1].xpath('a/@href').extract() if rows[index + 1].xpath( 25 | 'a/@href').extract() else rows[index - 1].xpath('a/@href').extract() 26 | 27 | print(tabulate([[keywords, url, matched_service, matched_url]], headers=['SERVICE', 'URL', 28 | 'CORRESPONDING SERVICES', 29 | 'CORRESPONDING URLS'])) 30 | return 31 | 32 | 33 | def runner(): 34 | parser = argparse.ArgumentParser(description='Enter the values to fetch the corresponding service') 35 | parser.add_argument('service', type=str, help='Enter the name of service') 36 | args = parser.parse_args() 37 | 38 | GithubSpider.service = args.service 39 | logging.getLogger('scrapy').propagate = False 40 | 41 | process = CrawlerProcess() 42 | process.crawl(GithubSpider) 43 | process.start() 44 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | # Inside of setup.cfg 2 | [metadata] 3 | description-file = README.md -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | 3 | setup( 4 | name='a2a', # How you named your package folder (MyLib) 5 | packages=['a2a'], # Chose the same as "name" 6 | version='0.44', # Start with a small number and increase it with every change you make 7 | license='MIT', # Chose a license from here: https://help.github.com/articles/licensing-a-repository 8 | description='Finds corresponding service offerings in Microsoft Azure and Amazon AWS .', 9 | # Give a short description about your library 10 | author='Kshitij Sharma', # Type in your name 11 | author_email='ikshitijsharma@gmail.com', # Type in your E-Mail 12 | url='https://github.com/kshitijcode/a2a', # Provide either the link to your github or to your website 13 | download_url='https://github.com/kshitijcode/a2a/archive/v0.43.tar.gz', # I explain this later on 14 | keywords=['aws', 'service', 'mapping', 'map', 'aws', 'amazon'], # Keywords that define your package best 15 | install_requires=[ # I get to this in a second 16 | 'scrapy', 17 | 'tabulate', 18 | ], 19 | entry_points={ 20 | 'console_scripts': [ 21 | 'a2a = a2a.runner:runner', 22 | ], 23 | } 24 | , 25 | classifiers=[ 26 | # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package 27 | 'Intended Audience :: Developers', # Define that your audience are developers 28 | 'Topic :: Software Development :: Build Tools', 29 | 'License :: OSI Approved :: MIT License', # Again, pick a license 30 | 'Programming Language :: Python :: 3', # Specify which python versions that you want to support 31 | 'Programming Language :: Python :: 3.4', 32 | 'Programming Language :: Python :: 3.5', 33 | 'Programming Language :: Python :: 3.6', 34 | ], 35 | ) 36 | --------------------------------------------------------------------------------