diff --git a/README.md b/README.md index 1a79794..ea8ea68 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ For convenience: * `hatch run lambda:prepare` will run steps 2-5 in a single command. * `hatch run lambda:deploy-no-dnssec` or `hatch run lambda:deploy-dnssec` will clean the environment and then run steps 2-6 with DNSSEC validation enabled or disabled respectively. +Note: the above commands do not run `tofu init`. During first time environment setup this will need to be run in the `open-tofu` dir for these commands to work. + ## Testing The following is an example of a test API call that uses bash command substitution to fill in the proper values for the API URL and the API key. @@ -93,7 +95,7 @@ If you would like to take the API down, run `tofu destroy` in the open-tofu dire After `tofu destroy`, `./clean.sh` in the root directory also clears generated/zip files. - +`hatch run lambda:destroy-tf` can be run as an alternative to `tofu destroy` # Remaining tasks diff --git a/open-tofu/.terraform.lock.hcl b/open-tofu/.terraform.lock.hcl index f513ffb..57b475c 100644 --- a/open-tofu/.terraform.lock.hcl +++ b/open-tofu/.terraform.lock.hcl @@ -5,6 +5,7 @@ provider "registry.opentofu.org/hashicorp/aws" { version = "5.52.0" hashes = [ "h1:T7V0+fbqJy7U5eh0jG9RwSnVJvAc+kaGTKIBTHn8iGQ=", + "h1:psXEDH5VJYdnkAUNa3GL9gQMHypStsGlRV0A7WmCSQY=", "h1:unJsDZsRkoORZTmJC9o8QbgCbM+0t3CJhicNo1m63Fg=", "zh:03cffc3a0f9f4e3d5cef6023c096b7b86b2604dd0a0ccaa00e57aaa3136963f9", "zh:480ccd23b78248940a1a9b3d4631bd7e667ddfc3a9ec4f35345752bf43d1ce54", diff --git a/pyproject.toml b/pyproject.toml index 424ce22..12ca804 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,13 +27,13 @@ classifiers = [ ] dependencies = [ # "open-mpic-core @ git+https://github.com/open-mpic/open-mpic-core-python.git@birgelee-key-auth-hash", - "pyyaml==6.0.1", + "pyyaml==6.0.2", "requests>=2.32.3", - "dnspython==2.6.1", - "pydantic==2.8.2", - "aiohttp==3.11.11", - "aws-lambda-powertools[parser]==3.2.0", - "open-mpic-core==5.2.0", + "dnspython==2.7.0", + "pydantic==2.10.6", + "aiohttp==3.11.13", + "aws-lambda-powertools[parser]==3.8.0", + "open-mpic-core==5.5.1", "aioboto3~=13.3.0", "black==24.8.0", ] @@ -56,7 +56,7 @@ Source = "https://github.com/open-mpic/aws-lambda-python" #virtual = ".hatch" [tool.api] -spec_version = "3.1.0" +spec_version = "3.3.0" spec_repository = "https://github.com/open-mpic/open-mpic-specification" [tool.hatch] @@ -87,10 +87,10 @@ PIP_ONLY_BINARY = ":all:" #PIP_TARGET = "layer/create_layer_virtualenv2/lib/python3.11/site-packages" # does not work... bug in pip 24.2? [tool.hatch.envs.lambda.scripts] -layer-install = "pip install . --platform manylinux2014_aarch64 --only-binary=:all: --target layer/create_layer_virtualenv/lib/python3.11/site-packages" -layer-package = "sh ./package-layer.sh" +layer-install = "pip install . --upgrade --platform manylinux2014_aarch64 --only-binary=:all: --target layer/create_layer_virtualenv/lib/python3.11/site-packages" +layer-package = "./package-layer.sh" configure-tf = "python configure.py" -zip-lambdas = "sh ./zip-all.sh" +zip-lambdas = "./zip-all.sh" apply-tf-dnssec = "(cd open-tofu && tofu apply -var=\"dnssec_enabled=true\" -auto-approve)" apply-tf-no-dnssec = "(cd open-tofu && tofu apply -var=\"dnssec_enabled=false\" -auto-approve)" destroy-tf = "(cd open-tofu && tofu destroy -auto-approve)" @@ -100,7 +100,7 @@ prepare = [ "configure-tf", "zip-lambdas" ] -clean = "sh ./clean.sh" +clean = "./clean.sh" deploy-dnssec = [ "clean", "prepare", diff --git a/src/aws_lambda_mpic/__about__.py b/src/aws_lambda_mpic/__about__.py index 3d26edf..5becc17 100644 --- a/src/aws_lambda_mpic/__about__.py +++ b/src/aws_lambda_mpic/__about__.py @@ -1 +1 @@ -__version__ = "0.4.1" +__version__ = "1.0.0" diff --git a/src/aws_lambda_mpic/mpic_coordinator_lambda/mpic_coordinator_lambda_function.py b/src/aws_lambda_mpic/mpic_coordinator_lambda/mpic_coordinator_lambda_function.py index c45f1d6..8d3ade9 100644 --- a/src/aws_lambda_mpic/mpic_coordinator_lambda/mpic_coordinator_lambda_function.py +++ b/src/aws_lambda_mpic/mpic_coordinator_lambda/mpic_coordinator_lambda_function.py @@ -13,7 +13,7 @@ from aws_lambda_powertools.utilities.parser import event_parser, envelopes from open_mpic_core import MpicRequest, CheckRequest, CheckResponse -from open_mpic_core import MpicRequestValidationError, MpicRequestValidationMessages +from open_mpic_core import MpicRequestValidationException, MpicRequestValidationMessages from open_mpic_core import MpicCoordinator, MpicCoordinatorConfiguration from open_mpic_core import CheckType from open_mpic_core import RemotePerspective @@ -196,7 +196,7 @@ def build_400_response(error_name, issues_list): def wrapper(*args, **kwargs): try: return func(*args, **kwargs) - except MpicRequestValidationError as e: + except MpicRequestValidationException as e: validation_issues = json.loads(e.__notes__[0]) return build_400_response(MpicRequestValidationMessages.REQUEST_VALIDATION_FAILED.key, validation_issues) except ValidationError as validation_error: