Skip to main content

·167 words·1 min

Modules
#

modules are created by a Makefile using the following directory tree where PKG gets replace wich the name of the module. All modules have a dxaws-* prefix

tree . └── dxaws-module ├── LICENSE ├── pyproject.toml ├── README.md ├── scripts ├── src │   └── PKG │   ├── init.py │   ├── constants.py │   ├── exceptions.py │   ├── manager.py │   ├── models.py │   └── providers │   ├── init.py │   ├── aws.py │   └── base.py └── tests ├── pycache │   ├── test_models.cpython-313-pytest-9.0.2.pyc │   ├── test_pkg_imports___PKG__.cpython-313-pytest-9.0.2.pyc │   └── test_provider_base.cpython-313-pytest-9.0.2.pyc ├── test_models.py ├── test_pkg_imports___PKG__.py └── test_provider_base.py

src/PKG/providers/aws.py manages the interface between the module and AWS. It inherits a class that establishes a boto session which looks something like this:

from dxaws_core import AwsSession
from dxaws_core.providers.aws import AwsProviderBase

class Route53Provider(AwsProviderBase):
    """Route53 provider.

    All boto3 and AWS-specific behavior lives in this class.
    Planner/executor code must not import boto3 directly.
    """

    def __init__(self, *, aws: AwsSession) -> None:
        super().__init__(aws=aws, provider_ns="dns.route53")
        # Route53 is effectively global, but boto3 still requires a region.
        self._client = self.client("route53")