Metadata-Version: 2.1
Name: aws_tgw_routes
Version: 1.0.3
Summary: Manage AWS Transit Gateway routes.
Home-page: https://gitlab.com/fer1035_python/modules/pypi-aws_tgw_routes
License: GPL-2.0-only
Keywords: aws,transit,gateway,vpc,network,routes
Author: Ahmad Ferdaus Abd Razak
Author-email: fer1035@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: aws_authenticator (>=2.0.2,<3.0.0)
Requires-Dist: boto3 (>=1.16.0,<2.0.0)
Project-URL: Repository, https://gitlab.com/fer1035_python/modules/pypi-aws_tgw_routes
Description-Content-Type: text/x-rst

==================
**aws_tgw_routes**
==================

Overview
--------

Manage AWS Transit Gateway routes.

Functions
---------

- get_tgw_routes
   - Filter by:
      - Transit Gateway Route Table IDs.
      - [Optional] Resource Types (vpc, vpn, direct-connect-gateway, peering, connect).
      - [Optional] States (active, blackhole).
      - [Optional] Types (static, propagated).
- add_tgw_routes
   - Add static routes: specify CIDR in route dictionary.
   - Add propagated routes: don't specify CIDR in route dictionary.

Usage
-----

- Installation:

.. code-block:: BASH

   pip3 install aws_tgw_routes
   # or
   python3 -m pip install aws_tgw_routes

- Set common environment variables (or use them as function arguments):

.. code-block:: BASH

   export AWS_ACCESS_KEY_ID=your_access_key_id
   export AWS_SECRET_ACCESS_KEY=your_secret_access_key
   export AWS_SESSION_TOKEN=your_session_token
   export AWS_REGION=your_aws_region

- GET examples:

Set environment variables (or use them as function arguments):

.. code-block:: BASH

   export AWS_TGW_RT_IDS=comma-separated_tgw_route_table_ids
   export RESOURCE_TYPES=comma-separated_resource_types
   export STATES=comma-separated_states
   export TYPES=comma-separated_types

Execute function:

.. code-block:: PYTHON

   from pprint import pprint
   from aws_tgw_routes import get_tgw_routes

   response = get_tgw_routes.main()
   pprint(response, indent=2)

- ADD examples:

Set function arguments and execute function:

.. code-block:: PYTHON

   from aws_tgw_routes import add_tgw_routes

   routes = [
      {
         "rt": "tgw-rtb-0123456789abcdef0",
         "att": "tgw-attach-0123456789abcdef0",
         "cidr": "10.0.0.0/16"
      },
      {
         "rt": "tgw-rtb-0123456789abcdef0",
         "att": "tgw-attach-0fedcba9876543210"
      }
   ]

   add_tgw_routes.main()

