diff --git a/Makefile_windows b/Makefile_windows new file mode 100644 index 00000000..bc75605e --- /dev/null +++ b/Makefile_windows @@ -0,0 +1,61 @@ +.PHONY: dev lint complex coverage pre-commit yapf sort deploy destroy deps unit integration e2e pipeline-tests docs lint-docs + + + +dev: + pipenv install -d + make deps + +lint: + @echo "Running flake8" + flake8 service/* cdk/* tests/* docs/examples/* --exclude patterns='build,cdk.json,cdk.context.json,.yaml' + +complex: + @echo "Running Radon" + radon cc -e 'tests/*,cdk.out/*' . + @echo "Running xenon" + xenon --max-absolute B --max-modules A --max-average A -e 'tests/*,.venv/*,cdk.out/*' . + +sort: + isort ${PWD} + +pre-commit: + pre-commit run -a --show-diff-on-failure + +deps: + pipenv requirements --dev > dev_requirements.txt + pipenv requirements > lambda_requirements.txt + +unit: + pytest tests\unit --cov-config=.coveragerc --cov=service --cov-report xml + +integration: + pytest tests/integration --cov-config=.coveragerc --cov=service --cov-report xml + +e2e: + pytest tests/e2e --cov-config=.coveragerc --cov=service --cov-report xml + +pr: deps yapf sort pre-commit complex lint lint-docs unit integration e2e + +yapf: + yapf -i -vv --style=./.style --exclude=.venv --exclude=.build --exclude=cdk.out --exclude=.git -r . + +pipeline-tests: + pytest tests/unit tests/integration --cov-config=.coveragerc --cov=service --cov-report xml + +deploy: + make deps + if not exist ".build\lambdas" mkdir ".build\lambdas" + xcopy /s /e /y service .build\lambdas + if not exist ".build\common_layer" mkdir ".build\common_layer" + pipenv requirements > .build\common_layer\requirements.txt + cdk deploy --app="python cdk\my_service\app.py" --require-approval=never + +destroy: + cdk destroy --app="python ${PWD}\cdk\my_service\app.py" --force + +docs: + mkdocs serve + +lint-docs: + docker run -v ${PWD}:/markdown 06kellyjac/markdownlint-cli --fix "docs" diff --git a/Pipfile.lock b/Pipfile.lock index 69b9b1f7..a73f6818 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -21,11 +21,12 @@ "all" ], "hashes": [ - "sha256:209147f942dbfc43e8fd0448c5aa494419368721851f73ab0761ec61a34c3617", - "sha256:57d19f67484153380e83ca21618967907d1608038426316f4947881bdd4375c4" + "sha256:7981eae02f68a15a9ac85c158d25cd7ef235a6c48c390774f15ae06d565524ed", + "sha256:a7084df09105770a032893b203347625d219f93a4e5f2b5ad4dd3a8942983cc7" ], "index": "pypi", - "version": "==2.2.0" + "markers": null, + "version": "==2.4.0" }, "aws-xray-sdk": { "hashes": [ @@ -36,11 +37,11 @@ }, "botocore": { "hashes": [ - "sha256:01f168e2418419a6d8b335ecc4330faa6a7332d5a097029fc9b4a3ae3c41cea2", - "sha256:c876a7c6a07d7f86f46a8cc765f0d38999b84ac1d7b0666d6ce08c0503e13145" + "sha256:26e86fce95049f6cc18b5611901549943c4c22522fa8a3b6b265404f673977b2", + "sha256:2aba44433b6eac6d3a12cf93f2985e2d7a843307c1a527042fc48dd09b273992" ], "markers": "python_version >= '3.7'", - "version": "==1.29.9" + "version": "==1.29.18" }, "fastjsonschema": { "hashes": [ @@ -124,11 +125,11 @@ }, "urllib3": { "hashes": [ - "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e", - "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997" + "sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc", + "sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4'", - "version": "==1.26.12" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", + "version": "==1.26.13" }, "wrapt": { "hashes": [ @@ -212,11 +213,35 @@ }, "aws-cdk-lib": { "hashes": [ - "sha256:60a44b4045cbe1ab33e001d62ded579a45b5f6b011c612f6804c109666807918", - "sha256:8f9157c906485308631edbf398a77641e5986aaccba73c3254502138a340a79a" + "sha256:6c4df94b74176ffdb7072d2be383608567816c918978f006f984299c04beb141", + "sha256:7fafb2ef55a66467e77dd44f03d533e8abde3729b247916dfdc5cf4ce1fe516d" ], "markers": "python_version ~= '3.7'", - "version": "==2.50.0" + "version": "==2.53.0" + }, + "aws-cdk.asset-awscli-v1": { + "hashes": [ + "sha256:c245323a23f81694ce9cadeef077e373a2ef451ee986a7f08921830be70a1cc3", + "sha256:e640a789ca459452f63ba5347e7009edf85b0fa051ffe23be683a19c6dc78675" + ], + "markers": "python_version ~= '3.7'", + "version": "==2.2.22" + }, + "aws-cdk.asset-kubectl-v20": { + "hashes": [ + "sha256:9834cdb150c5590aea4e5eba6de2a89b4c60617451181c524810c5a75154565c", + "sha256:a2fad1a5a35a94a465efe60859f91e45dacc33261fb9bbf1cf9bbc6e2f70e9d6" + ], + "markers": "python_version ~= '3.7'", + "version": "==2.1.1" + }, + "aws-cdk.asset-node-proxy-agent-v5": { + "hashes": [ + "sha256:715beb3f91aae4b8a293eb28e02d364cf37d7ef3a88db1647a983bba328d144c", + "sha256:c57c3e44aa9d5440320a408c8f10858ebb896466ea442ac8024c7529d84fa3c1" + ], + "markers": "python_version ~= '3.7'", + "version": "==2.0.28" }, "aws-cdk.aws-lambda-python-alpha": { "hashes": [ @@ -226,21 +251,25 @@ "markers": "python_version ~= '3.7'", "version": "==2.50.0a0" }, + "aws-lambda-handler-cookbook": { + "editable": true, + "path": "./cdk" + }, "boto3": { "hashes": [ - "sha256:15b059251990706c5d5a556c42a6e6e781a51edadf48a42afdd06bd313adfaf2", - "sha256:27efa5eb229364bc4643d9e182de0891f73c21b65ef80b5bd02a977caeaf595c" + "sha256:3c7315da16eb0b41823965e5ce55f99cb07e94680e0ed7830c581f505fb5bd15", + "sha256:933c88b189112a5fdd82d49ef00f95b9dd649d195e557a81aecb773a3e01c517" ], "index": "pypi", - "version": "==1.26.9" + "version": "==1.26.18" }, "botocore": { "hashes": [ - "sha256:01f168e2418419a6d8b335ecc4330faa6a7332d5a097029fc9b4a3ae3c41cea2", - "sha256:c876a7c6a07d7f86f46a8cc765f0d38999b84ac1d7b0666d6ce08c0503e13145" + "sha256:26e86fce95049f6cc18b5611901549943c4c22522fa8a3b6b265404f673977b2", + "sha256:2aba44433b6eac6d3a12cf93f2985e2d7a843307c1a527042fc48dd09b273992" ], "markers": "python_version >= '3.7'", - "version": "==1.29.9" + "version": "==1.29.18" }, "cattrs": { "hashes": [ @@ -250,17 +279,13 @@ "markers": "python_version >= '3.7'", "version": "==22.2.0" }, - "cdk": { - "editable": true, - "path": "./cdk" - }, "cdk-nag": { "hashes": [ - "sha256:3cde384c8aaa1fe6dc1bb5f2fd3eda283148c5bc9814a87de02ad7cb6aa9ba2d", - "sha256:7edbd8bb8d9076ceecbd4977c2df14971a1d0df632ccccfadd02fb58e92ff7c1" + "sha256:58e4c790127b1f843b4ac2cc8d162d5e83f53ae069c3915c939cb200df5e0de5", + "sha256:b3078e38c241716b5bd68b4945f558fc251c722b0de3468e0e1f1aab306ac0ac" ], "markers": "python_version ~= '3.7'", - "version": "==2.20.11" + "version": "==2.21.16" }, "certifi": { "hashes": [ @@ -283,7 +308,7 @@ "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845", "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f" ], - "markers": "python_version >= '3.6'", + "markers": "python_full_version >= '3.6.0'", "version": "==2.1.1" }, "click": { @@ -304,11 +329,11 @@ }, "constructs": { "hashes": [ - "sha256:384175d57d80dd40503d2a596bb02d67e279eb327b993482a45eeabab4dce810", - "sha256:3af0fe656a5c6687e3b6ad8850346fe54973801c23c9401031a6b7d340a170b9" + "sha256:6968efd5f837f3a43d5a93808424744cdcd03f53df764be78123f60e81b39b0a", + "sha256:af9bd1f0bd6882a6a608bc335a4f8a230f498072bff83d9126d43c486e30305b" ], "markers": "python_version ~= '3.7'", - "version": "==10.1.160" + "version": "==10.1.174" }, "coverage": { "extras": [ @@ -378,11 +403,11 @@ }, "exceptiongroup": { "hashes": [ - "sha256:6002703c7d31fb9950ddc8780840f67880c440895dc1151dd551553aa1246e4a", - "sha256:76cac74b5207c5997678a1c7105cb6f14213c9c63c096a38cfcb529d83ce5c02" + "sha256:542adf9dea4055530d6e1279602fa5cb11dab2395fa650b8674eaec35fc4a828", + "sha256:bd14967b79cd9bdb54d97323216f8fdf533e278df937aa2a90089e7d6e06e5ec" ], "markers": "python_version < '3.11'", - "version": "==1.0.3" + "version": "==1.0.4" }, "filelock": { "hashes": [ @@ -394,11 +419,11 @@ }, "flake8": { "hashes": [ - "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db", - "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248" + "sha256:3833794e27ff64ea4e9cf5d410082a8b97ff1a06c16aa3d2027339cd0f1195c7", + "sha256:c61007e76655af75e6785a931f452915b371dc48f56efd765247c8fe68f2b181" ], "index": "pypi", - "version": "==5.0.4" + "version": "==6.0.0" }, "future": { "hashes": [ @@ -416,11 +441,11 @@ }, "gitdb": { "hashes": [ - "sha256:8033ad4e853066ba6ca92050b9df2f89301b8fc8bf7e9324d412a63f8bf1a8fd", - "sha256:bac2fd45c0a1c9cf619e63a90d62bdc63892ef92387424b855792a6cabe789aa" + "sha256:6eb990b69df4e15bad899ea868dc46572c3f75339735663b81de79b06f17eb9a", + "sha256:c286cf298426064079ed96a9e4a9d39e7f3e9bf15ba60701e95f5492f28415c7" ], - "markers": "python_version >= '3.6'", - "version": "==4.0.9" + "markers": "python_version >= '3.7'", + "version": "==4.0.10" }, "gitpython": { "hashes": [ @@ -432,11 +457,11 @@ }, "identify": { "hashes": [ - "sha256:48b7925fe122720088aeb7a6c34f17b27e706b72c61070f27fe3789094233440", - "sha256:7a214a10313b9489a0d61467db2856ae8d0b8306fc923e03a9effa53d8aedc58" + "sha256:906036344ca769539610436e40a684e170c3648b552194980bb7b617a8daeb9f", + "sha256:a390fb696e164dbddb047a0db26e57972ae52fbd037ae68797e5ae2f4492485d" ], "markers": "python_version >= '3.7'", - "version": "==2.5.8" + "version": "==2.5.9" }, "idna": { "hashes": [ @@ -448,11 +473,11 @@ }, "importlib-metadata": { "hashes": [ - "sha256:da31db32b304314d044d3c12c79bd59e307889b287ad12ff387b3500835fc2ab", - "sha256:ddb0e35065e8938f867ed4928d0ae5bf2a53b7773871bfe6bcc7e4fcdc7dea43" + "sha256:d5059f9f1e8e41f80e9c56c2ee58811450c31984dfa625329ffd7c0dad88a73b", + "sha256:d84d17e21670ec07990e1044a99efe8d615d860fd176fc29ef5c306068fda313" ], "markers": "python_version < '3.10'", - "version": "==5.0.0" + "version": "==5.1.0" }, "iniconfig": { "hashes": [ @@ -595,11 +620,11 @@ }, "mkdocs-material-extensions": { "hashes": [ - "sha256:96ca979dae66d65c2099eefe189b49d5ac62f76afb59c38e069ffc7cf3c131ec", - "sha256:bcc2e5fc70c0ec50e59703ee6e639d87c7e664c0c441c014ea84461a90f1e902" + "sha256:9c003da71e2cc2493d910237448c672e00cefc800d3d6ae93d2fc69979e3bd93", + "sha256:e41d9f38e4798b6617ad98ca8f7f1157b1e4385ac1459ca1e4ea219b556df945" ], "markers": "python_version >= '3.7'", - "version": "==1.1" + "version": "==1.1.1" }, "nodeenv": { "hashes": [ @@ -658,19 +683,19 @@ }, "pycodestyle": { "hashes": [ - "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785", - "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b" + "sha256:347187bdb476329d98f695c213d7295a846d1152ff4fe9bacb8a9590b8ee7053", + "sha256:8a4eaf0d0495c7395bdab3589ac2db602797d76207242c17d470186815706610" ], "index": "pypi", - "version": "==2.9.1" + "version": "==2.10.0" }, "pyflakes": { "hashes": [ - "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2", - "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3" + "sha256:ec55bf7fe21fff7f1ad2f7da62363d749e2a470500eab1b555334b67aa1ef8cf", + "sha256:ec8b276a6b60bd80defed25add7e439881c19e64850afd9b346283d4165fd0fd" ], "markers": "python_version >= '3.6'", - "version": "==2.5.0" + "version": "==3.0.1" }, "pygments": { "hashes": [ @@ -682,11 +707,11 @@ }, "pymdown-extensions": { "hashes": [ - "sha256:1bd4a173095ef8c433b831af1f3cb13c10883be0c100ae613560668e594651f7", - "sha256:8e62688a8b1128acd42fa823f3d429d22f4284b5e6dd4d3cd56721559a5a211b" + "sha256:0f8fb7b74a37a61cc34e90b2c91865458b713ec774894ffad64353a5fce85cfc", + "sha256:ac698c15265680db5eb13cd4342abfcde2079ac01e5486028f47a1b41547b859" ], "markers": "python_version >= '3.7'", - "version": "==9.8" + "version": "==9.9" }, "pyparsing": { "hashes": [ @@ -819,7 +844,7 @@ "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983", "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349" ], - "markers": "python_version >= '3.7' and python_version < '4.0'", + "markers": "python_version >= '3.7' and python_version < '4'", "version": "==2.28.1" }, "s3transfer": { @@ -830,17 +855,13 @@ "markers": "python_version >= '3.7'", "version": "==0.6.0" }, - "service-cdk": { - "editable": true, - "path": "cdk" - }, "setuptools": { "hashes": [ - "sha256:d0b9a8433464d5800cbe05094acf5c6d52a91bfac9b52bcfc4d41382be5d5d31", - "sha256:e197a19aa8ec9722928f2206f8de752def0e4c9fc6953527360d1c36d94ddb2f" + "sha256:57f6f22bde4e042978bcd50176fdb381d7c21a9efa4041202288d3737a0c6a54", + "sha256:a7620757bf984b58deaf32fc8a4577a9bbc0850cf92c20e1ce41c38c19e5fb75" ], "markers": "python_version >= '3.7'", - "version": "==65.5.1" + "version": "==65.6.3" }, "six": { "hashes": [ @@ -892,19 +913,19 @@ }, "urllib3": { "hashes": [ - "sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e", - "sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997" + "sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc", + "sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4'", - "version": "==1.26.12" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", + "version": "==1.26.13" }, "virtualenv": { "hashes": [ - "sha256:8691e3ff9387f743e00f6bb20f70121f5e4f596cae754531f2b3b3a1b1ac696e", - "sha256:efd66b00386fdb7dbe4822d172303f40cd05e50e01740b19ea42425cbe653e29" + "sha256:40a7e06a98728fd5769e1af6fd1a706005b4bb7e16176a272ed4292473180389", + "sha256:7d6a8d55b2f73b617f684ee40fd85740f062e1f2e379412cb1879c7136f05902" ], "markers": "python_version >= '3.6'", - "version": "==20.16.7" + "version": "==20.17.0" }, "watchdog": { "hashes": [ @@ -955,11 +976,11 @@ }, "zipp": { "hashes": [ - "sha256:4fcb6f278987a6605757302a6e40e896257570d11c51628968ccb2a47e80c6c1", - "sha256:7a7262fd930bd3e36c50b9a64897aec3fafff3dfdeec9623ae22b40e93f99bb8" + "sha256:83a28fcb75844b5c0cdaf5aa4003c2d728c77e05f5aeabe8e95e56727005fbaa", + "sha256:a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766" ], "markers": "python_version >= '3.7'", - "version": "==3.10.0" + "version": "==3.11.0" } } } diff --git a/cdk/my_service/app.py b/cdk/my_service/app.py index 5c5bec2b..dd71c10c 100755 --- a/cdk/my_service/app.py +++ b/cdk/my_service/app.py @@ -3,8 +3,7 @@ from aws_cdk import App, Environment from boto3 import client, session -from service_stack.constants import get_stack_name -from service_stack.service_stack import ServiceStack +from service_stack.service_stack import ServiceStack, get_stack_name account = client('sts').get_caller_identity()['Account'] region = session.Session().region_name diff --git a/cdk/my_service/service_stack/constants.py b/cdk/my_service/service_stack/constants.py index a17587cc..12b3a947 100644 --- a/cdk/my_service/service_stack/constants.py +++ b/cdk/my_service/service_stack/constants.py @@ -17,7 +17,3 @@ ENVIRONMENT = 'dev' CONFIGURATION_NAME = 'my_conf' CONFIGURATION_MAX_AGE_MINUTES = '5' # time to store app config conf in the cache before refetching it - - -def get_stack_name() -> str: - return SERVICE_NAME diff --git a/cdk/my_service/service_stack/service_stack.py b/cdk/my_service/service_stack/service_stack.py index 1d3dffcb..f3a5441c 100644 --- a/cdk/my_service/service_stack/service_stack.py +++ b/cdk/my_service/service_stack/service_stack.py @@ -10,14 +10,14 @@ from my_service.service_stack.service_construct import ApiConstruct -def _get_stack_prefix() -> str: +def get_stack_name() -> str: repo = Repo(Path.cwd()) - username = pwd.getpwuid(os.getuid()).pw_name + username = pwd.getpwuid(os.getuid()).pw_name.replace('.', '-') print(f'username={username}') try: - return f'{username}{repo.active_branch}' + return f'{username}-{repo.active_branch}-{SERVICE_NAME}' except TypeError: - return username + return f'{username}-{SERVICE_NAME}' class ServiceStack(Stack): @@ -28,6 +28,5 @@ def __init__(self, scope: Construct, id: str, **kwargs) -> None: # This construct should be deployed in a different repo and have its own pipeline so updates can be decoupled # from running the service pipeline and without redeploying the service lambdas. For the sake of this template # example, it is deployed as part of the service stack - prefix = _get_stack_prefix() - self.dynamic_configuration = ConfigurationStore(self, f'{prefix}dynamic_conf'[0:64], ENVIRONMENT, SERVICE_NAME, CONFIGURATION_NAME) - self.lambdas = ApiConstruct(self, f'{prefix}Service'[0:64]) + self.dynamic_configuration = ConfigurationStore(self, 'dynamic_conf'[0:64], ENVIRONMENT, SERVICE_NAME, CONFIGURATION_NAME) + self.lambdas = ApiConstruct(self, 'Service'[0:64]) diff --git a/dev_requirements.txt b/dev_requirements.txt index e35c0a0e..91a09eb0 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,84 +1,86 @@ -i https://pypi.org/simple -attrs==22.1.0; python_version >= '3.5' -aws-cdk-lib==2.50.0; python_version ~= '3.7' -aws-cdk.aws-lambda-python-alpha==2.50.0a0; python_version ~= '3.7' -boto3==1.26.9 -botocore==1.29.9; python_version >= '3.7' -cattrs==22.2.0; python_version >= '3.7' +attrs==22.1.0 ; python_version >= '3.5' +aws-cdk-lib==2.53.0 ; python_version ~= '3.7' +aws-cdk.asset-awscli-v1==2.2.22 ; python_version ~= '3.7' +aws-cdk.asset-kubectl-v20==2.1.1 ; python_version ~= '3.7' +aws-cdk.asset-node-proxy-agent-v5==2.0.28 ; python_version ~= '3.7' +aws-cdk.aws-lambda-python-alpha==2.50.0a0 ; python_version ~= '3.7' -e ./cdk -cdk-nag==2.20.11; python_version ~= '3.7' -certifi==2022.9.24; python_version >= '3.6' -cfgv==3.3.1; python_full_version >= '3.6.1' -charset-normalizer==2.1.1; python_version >= '3.6' -click==8.1.3; python_version >= '3.7' -colorama==0.4.6; python_version >= '3.5' -constructs==10.1.160; python_version ~= '3.7' -coverage[toml]==6.5.0; python_version >= '3.7' +boto3==1.26.18 +botocore==1.29.18 ; python_version >= '3.7' +cattrs==22.2.0 ; python_version >= '3.7' +cdk-nag==2.21.16 ; python_version ~= '3.7' +certifi==2022.9.24 ; python_version >= '3.6' +cfgv==3.3.1 ; python_full_version >= '3.6.1' +charset-normalizer==2.1.1 ; python_full_version >= '3.6.0' +click==8.1.3 ; python_version >= '3.7' +colorama==0.4.6 ; python_version >= '3.5' +constructs==10.1.174 ; python_version ~= '3.7' +coverage[toml]==6.5.0 ; python_version >= '3.7' distlib==0.3.6 -exceptiongroup==1.0.3; python_version < '3.11' -filelock==3.8.0; python_version >= '3.7' -flake8==5.0.4 -future==0.18.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3' +exceptiongroup==1.0.4 ; python_version < '3.11' +filelock==3.8.0 ; python_version >= '3.7' +flake8==6.0.0 +future==0.18.2 ; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3' ghp-import==2.1.0 -gitdb==4.0.9; python_version >= '3.6' +gitdb==4.0.10 ; python_version >= '3.7' gitpython==3.1.29 -identify==2.5.8; python_version >= '3.7' -idna==3.4; python_version >= '3.5' -importlib-metadata==5.0.0; python_version < '3.10' +identify==2.5.9 ; python_version >= '3.7' +idna==3.4 ; python_version >= '3.5' +importlib-metadata==5.1.0 ; python_version < '3.10' iniconfig==1.1.1 isort==5.10.1 -jinja2==3.1.2; python_version >= '3.7' -jmespath==1.0.1; python_version >= '3.7' -jsii==1.71.0; python_version ~= '3.7' +jinja2==3.1.2 ; python_version >= '3.7' +jmespath==1.0.1 ; python_version >= '3.7' +jsii==1.71.0 ; python_version ~= '3.7' mando==0.6.4 -markdown==3.3.7; python_version >= '3.6' -markupsafe==2.1.1; python_version >= '3.7' -mccabe==0.7.0; python_version >= '3.6' -mergedeep==1.3.4; python_version >= '3.6' -mkdocs==1.4.2; python_version >= '3.7' +markdown==3.3.7 ; python_version >= '3.6' +markupsafe==2.1.1 ; python_version >= '3.7' +mccabe==0.7.0 ; python_version >= '3.6' +mergedeep==1.3.4 ; python_version >= '3.6' +mkdocs==1.4.2 ; python_version >= '3.7' mkdocs-git-revision-date-plugin==0.3.2 mkdocs-material==8.5.10 -mkdocs-material-extensions==1.1; python_version >= '3.7' -nodeenv==1.7.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' -packaging==21.3; python_version >= '3.6' -platformdirs==2.5.4; python_version >= '3.7' -pluggy==1.0.0; python_version >= '3.6' +mkdocs-material-extensions==1.1.1 ; python_version >= '3.7' +nodeenv==1.7.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6' +packaging==21.3 ; python_version >= '3.6' +platformdirs==2.5.4 ; python_version >= '3.7' +pluggy==1.0.0 ; python_version >= '3.6' pre-commit==2.20.0 publication==0.0.3 -py==1.11.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' -pycodestyle==2.9.1 -pyflakes==2.5.0; python_version >= '3.6' -pygments==2.13.0; python_version >= '3.6' -pymdown-extensions==9.8; python_version >= '3.7' -pyparsing==3.0.9; python_full_version >= '3.6.8' +py==1.11.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' +pycodestyle==2.10.0 +pyflakes==3.0.1 ; python_version >= '3.6' +pygments==2.13.0 ; python_version >= '3.6' +pymdown-extensions==9.9 ; python_version >= '3.7' +pyparsing==3.0.9 ; python_full_version >= '3.6.8' pytest==7.2.0 pytest-cov==4.0.0 pytest-html==3.2.0 -pytest-metadata==2.0.4; python_version >= '3.7' and python_version < '4.0' +pytest-metadata==2.0.4 ; python_version >= '3.7' and python_version < '4.0' pytest-mock==3.10.0 -python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +python-dateutil==2.8.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' python-dotenv==0.21.0 -pyyaml==6.0; python_version >= '3.6' -pyyaml-env-tag==0.1; python_version >= '3.6' +pyyaml==6.0 ; python_version >= '3.6' +pyyaml-env-tag==0.1 ; python_version >= '3.6' radon==5.1.0 -requests==2.28.1; python_version >= '3.7' and python_version < '4.0' -s3transfer==0.6.0; python_version >= '3.7' --e ./cdk -setuptools==65.5.1; python_version >= '3.7' -six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -smmap==5.0.0; python_version >= '3.6' -toml==0.10.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3' -tomli==2.0.1; python_version < '3.11' -typeguard==2.13.3; python_full_version >= '3.5.3' -typing-extensions==4.4.0; python_version >= '3.7' -urllib3==1.26.12; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4' -virtualenv==20.16.7; python_version >= '3.6' -watchdog==2.1.9; python_version >= '3.6' +requests==2.28.1 ; python_version >= '3.7' and python_version < '4' +s3transfer==0.6.0 ; python_version >= '3.7' +setuptools==65.6.3 ; python_version >= '3.7' +six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +smmap==5.0.0 ; python_version >= '3.6' +toml==0.10.2 ; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3' +tomli==2.0.1 ; python_version < '3.11' +typeguard==2.13.3 ; python_full_version >= '3.5.3' +typing-extensions==4.4.0 ; python_version >= '3.7' +urllib3==1.26.13 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' +virtualenv==20.17.0 ; python_version >= '3.6' +watchdog==2.1.9 ; python_version >= '3.6' xenon==0.9.0 yapf==0.32.0 -zipp==3.10.0; python_version >= '3.7' -aws-lambda-powertools[all]==2.2.0 +zipp==3.11.0 ; python_version >= '3.7' +aws-lambda-powertools[all]==2.4.0 aws-xray-sdk==2.11.0 fastjsonschema==2.16.2 pydantic==1.10.2 -wrapt==1.14.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' +wrapt==1.14.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' diff --git a/docs/getting_started.md b/docs/getting_started.md index 3eb2ac8e..1d901a98 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -7,6 +7,7 @@ description: AWS Lambda Cookbook Project Getting started * **Docker** - install [Docker](https://www.docker.com/){target="_blank"}. Required for the Lambda layer packaging process. * **[AWS CDK](cdk.md)** - Required for synth & deploying the AWS Cloudformation stack. * Python 3.9 +* For Windows based machines, use the Makefile_windows version (rename to Makefile). Default Makefile is for Mac/Linux. ## **Creating a Virtual Python Environment** diff --git a/lambda_requirements.txt b/lambda_requirements.txt index d51c2f62..26d8b294 100644 --- a/lambda_requirements.txt +++ b/lambda_requirements.txt @@ -1,12 +1,12 @@ -i https://pypi.org/simple -aws-lambda-powertools[all]==2.2.0 +aws-lambda-powertools[all]==2.4.0 aws-xray-sdk==2.11.0 -botocore==1.29.9; python_version >= '3.7' +botocore==1.29.18 ; python_version >= '3.7' fastjsonschema==2.16.2 -jmespath==1.0.1; python_version >= '3.7' +jmespath==1.0.1 ; python_version >= '3.7' pydantic==1.10.2 -python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' -typing-extensions==4.4.0; python_version >= '3.7' -urllib3==1.26.12; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4' -wrapt==1.14.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' +python-dateutil==2.8.2 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +six==1.16.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3' +typing-extensions==4.4.0 ; python_version >= '3.7' +urllib3==1.26.13 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' +wrapt==1.14.1 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' diff --git a/tests/utils.py b/tests/utils.py index ab39cc11..b4c2ceef 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -4,7 +4,7 @@ import boto3 from aws_lambda_powertools.utilities.typing import LambdaContext -from cdk.my_service.service_stack.constants import get_stack_name +from cdk.my_service.service_stack.service_stack import get_stack_name def generate_context() -> LambdaContext: