developmentseed / developmentseed/eoapi-cdk

Link aws-cdk-lib versions between node and Python

Open
#218 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29
Forks
6
Avg merge
1d 2h
Merged PRs (30d)
7

Description

I've run into problems when the node version of **aws-cdk-lib** used to [build the Python bindings](https://github.com/developmentseed/eoapi-cdk/blob/03472ba911e7fc791ed50d33b3883ac6909a82ed/.github/workflows/build.yaml#L31-L32) differs from the version used in a Python project that's deploying via **eoapi-cdk**. In particular, breaking changes to the **aws-cdk-lib** can lead to hard-to-debug tracebacks like this one, which occurred because of a breaking change [v2.224.0](https://github.com/aws/aws-cdk/releases/tag/v2.224.0) of **eoapi-cdk**:

```text
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/home/runner/work/ava-backend/ava-backend/infrastructure/aws/app.py", line 6, in
from .stacks.app import AppStack
File "/home/runner/work/ava-backend/ava-backend/infrastructure/aws/stacks/app.py", line 8, in
from eoapi_cdk import (
File "/home/runner/work/ava-backend/ava-backend/.venv/lib/python3.12/site-packages/eoapi_cdk/__init__.py", line 1043, in
class PgStacDatabase(
File "/home/runner/work/ava-backend/ava-backend/.venv/lib/python3.12/site-packages/eoapi_cdk/__init__.py", line 1122, in PgStacDatabase
storage_encryption_key: typing.Optional[_aws_cdk_aws_kms_ceddda9d.IKeyRef] = None,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'aws_cdk.aws_kms' has no attribute 'IKeyRef'
```

The simplest solution might just be explicitly pinning the **aws-cdk-version** in both `package.json` and as a required dependency in `pyproject.toml` (it's currently optional), but there maybe be a more elegant way? I'm also curious why **aws-cdk-lib** _isn't_ a required dependency of the Python package to begin with...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.