MARE AWS COMMON LIB¶
Description¶
mare_aws_common_lib is a Python package providing utilities for managing AWS Cloud Development Kit (CDK) environments and resources.
It provides a collection of builders for AWS resources, each of which is designed to simplify and streamline the process of defining and provisioning AWS resources using the AWS CDK. These builders are modular and easily extendable, allowing developers to work more efficiently with AWS services.
Pipeline¶
There is a pipeline configured that will build and release the package in CodeArtifact so that it can be used through pip.
The pipeline is automatically triggered by new commits on the master branch.
The pipeline will fail if there is no version increase.
Usage¶
Environment setup¶
Note
You must have nodejs, python >=3.12 and pip pre-installed.
- Install aws cdk
npm install -g aws-cdk - Create a venv and activate it:
python -m venv ~/venv/.mare-env source ~/venv/.mare-env/bin/activate
Installation for local development¶
- Clone the repo
git clone https://git-codecommit.eu-west-1.amazonaws.com/v1/repos/mare_aws_common_lib - Install the dependencies and library in your venv
pip install -r requirements.txt -
In order to have proper intellisense in your IDE you will need to build the package and install it. You have two possibilities:
- Static install: your IDE will automatically detect the package, however, every time you make a change to this package you need to build and install the library:
python -m build pip install dist/mare_aws_common_lib-0.2.2-py3-none-any.whl --force-reinstall # version number might need to be updated, check setup.cfg to get the version number - Development install: for your IDE to detect the package you'll need to do additinal configurations there, this will allow you to develop and test your changes without building
pip install -e .
- Static install: your IDE will automatically detect the package, however, every time you make a change to this package you need to build and install the library:
-
After installing the package, you can run the tests:
pytest tests/test_enum.py
Installation as a dependency for your CDK project¶
In your CDK project you should have a requirements.txt file similar to the following:
aws-cdk-lib==2.187.0
constructs>=10.3.0,<11.0.0
mare_aws_common_lib==0.2.2
The mare_aws_common_lib is published in AWS CodeArtifact. In order to be able to fetch this dependency from there you need to do the following:
aws codeartifact login --tool pip --domain mare-foundation --repository mare_aws_common_lib --profile mare-devops
# now you can install all your dependencies
pip install -r requirements.txt