Skip to main content

Manage AWS Transit Gateway routes.

Project description

Overview

Manage AWS Transit Gateway routes.

Functions

  • get_tgw_routes
    • Filter by:
      • Transit Gateway Route Table IDs.

      • Resource Types (vpc, vpn, direct-connect-gateway, peering, connect).

      • States (active, blackhole).

      • 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:

pip3 install aws_tgw_routes
# or
python3 -m pip install aws_tgw_routes
  • Set common environment variables (or use them as function arguments):

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):

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:

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:

from pprint import pprint
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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws_tgw_routes-1.0.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_tgw_routes-1.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file aws_tgw_routes-1.0.1.tar.gz.

File metadata

  • Download URL: aws_tgw_routes-1.0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/5.15.154+

File hashes

Hashes for aws_tgw_routes-1.0.1.tar.gz
Algorithm Hash digest
SHA256 268b2e743b4667559ca18d002a2696fbccd73dc083d85fe96ce8f5148b7ddd26
MD5 98c0c59cd3e75d6c6204fe9efc7a3d15
BLAKE2b-256 bf30d181ba451ac894653f8eca16cc3d847c08116c838d1ff5eccdc5735325cc

See more details on using hashes here.

File details

Details for the file aws_tgw_routes-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: aws_tgw_routes-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Linux/5.15.154+

File hashes

Hashes for aws_tgw_routes-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e62b7cab8f23398a91ecd9effe96129cd061a3397a4fbd28fc7904fb29563336
MD5 ab8dfa2c9810f7d9e5d6b04206d2e521
BLAKE2b-256 68fb16ee5f16a3ed11913f7ae144b9e12bfe0c3103580f9bfdb1c51b46350882

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page