.. core-aws-cdk documentation master file, created by sphinx-quickstart on Sat May 10 17:27:32 2025. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. core-aws-cdk =============================================================================== This project contains common elements and constructs to create infrastructure in AWS using AWS CDK with Python. =============================================================================== .. image:: https://img.shields.io/pypi/pyversions/core-aws-cdk.svg :target: https://pypi.org/project/core-aws-cdk/ :alt: Python Versions .. image:: https://img.shields.io/badge/license-MIT-blue.svg :target: https://gitlab.com/bytecode-solutions/core/core-aws-cdk/-/blob/main/LICENSE :alt: License .. image:: https://gitlab.com/bytecode-solutions/core/core-aws-cdk/badges/release/pipeline.svg :target: https://gitlab.com/bytecode-solutions/core/core-aws-cdk/-/pipelines :alt: Pipeline Status .. image:: https://readthedocs.org/projects/core-aws-cdk/badge/?version=latest :target: https://readthedocs.org/projects/core-aws-cdk/ :alt: Docs Status .. image:: https://img.shields.io/badge/security-bandit-yellow.svg :target: https://github.com/PyCQA/bandit :alt: Security Documentation Contents ------------------------------------------------------------------------------- .. toctree:: :maxdepth: 1 :caption: Index: quickstart testing stacks utils .. toctree:: :maxdepth: 1 :caption: Additional Resources: examples troubleshooting changelog Features ------------------------------------------------------------------------------- * **Base Stacks**: Pre-configured CDK stacks with tagging support * **Lambda Functions**: Simplified Lambda creation with automatic packaging * **S3 Buckets**: S3 bucket creation with security best practices * **SQS Queues**: Queue creation with dead-letter queue support * **SNS Topics**: Topic creation with subscription management * **Network Stack**: VPC and networking resource management * **ZIP Asset Packaging**: Automatic Lambda ZIP creation with dependencies Installation ------------------------------------------------------------------------------- Install from PyPI using pip: .. code-block:: bash pip install core-aws-cdk uv pip install core-aws-cdk # Or using UV... pip install -e ".[dev]" # For development... Setting Up Environment ------------------------------------------------------------------------------- 1. Install required libraries: .. code-block:: bash pip install --upgrade pip pip install virtualenv 2. Create Python virtual environment: .. code-block:: bash virtualenv --python=python3.12 .venv 3. Activate the virtual environment: .. code-block:: bash source .venv/bin/activate Install packages ------------------------------------------------------------------------------- .. code-block:: bash pip install . pip install -e ".[dev]" Check tests and coverage ------------------------------------------------------------------------------- .. code-block:: shell python manager.py run-tests python manager.py run-tests --test-type integration python manager.py run-coverage # Having proper AWS credentials... python manager.py run-tests --test-type functional --pattern "*.py" # Or using `pytest`... pytest -n auto Run specific test file: .. code-block:: shell pytest tests/functional/test_lambda_creation.py Run specific test: .. code-block:: shell pytest tests/functional/test_lambda_creation.py::TestLambdaCreation::test_create_and_invoke_lambda_with_inline_code Run tests in parallel using all CPUs: .. code-block:: shell pytest -n auto Run with specific number of workers: .. code-block:: shell pytest -n 4 # Use 4 parallel workers Run functional tests with limited parallelism (recommended): .. code-block:: shell pytest tests/functional/ -n 2 # Avoid AWS rate limits **IMPORTANT:** Functional tests deploy real resources to AWS and may incur costs and require AWS credentials configured. Prerequisites ------------------------------------------------------------------------------- 1. AWS credentials configured. 2. CDK CLI installed `npm install -g aws-cdk`. 3. Required AWS permissions: * Lambda (create, invoke, delete) * S3 (create bucket, put/get objects, delete) * SNS (create topic, publish) * SQS (create queue, send/receive messages) * CloudFormation (create/update/delete stacks) * IAM (create roles and policies) Important Notes: * Tests automatically clean up resources after completion * Each test uses temporary directories and unique resource names * Tests include 10-minute timeouts for deployment and cleanup * All logs captured with DEBUG level for troubleshooting Contributing ------------------------------------------------------------------------------- Contributions are welcome! Please: 1. Fork the repository 2. Create a feature branch 3. Write tests for new functionality 4. Ensure all tests pass: ``pytest -n auto`` 5. Run linting: ``pylint core_aws_cdk`` 6. Run security checks: ``bandit -r core_aws_cdk`` 7. Submit a pull request License ------------------------------------------------------------------------------- This project is licensed under the MIT License. See the LICENSE file for details. Links ------------------------------------------------------------------------------- * **Documentation:** https://core-aws-cdk.readthedocs.io/en/latest/ * **Repository:** https://gitlab.com/bytecode-solutions/core/core-aws-cdk * **Issues:** https://gitlab.com/bytecode-solutions/core/core-aws-cdk/-/issues * **Changelog:** https://gitlab.com/bytecode-solutions/core/core-aws-cdk/-/blob/master/CHANGELOG.md * **PyPI:** https://pypi.org/project/core-aws-cdk/ Support ------------------------------------------------------------------------------- For questions or support, please open an issue on GitLab or contact the maintainers. Authors ------------------------------------------------------------------------------- * **Alejandro Cora González** - *Initial work* - alek.cora.glez@gmail.com Indices and Tables ------------------------------------------------------------------------------- * :ref:`genindex` * :ref:`modindex` * :ref:`search`