Skip to content

Commit bbf9239

Browse files
authored
chore: Update pip and log retention (#200)
1 parent 807d0cc commit bbf9239

File tree

9 files changed

+227
-124
lines changed

9 files changed

+227
-124
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"cSpell.words": [
3+
"appconfig",
34
"Codecov",
4-
"ranisenberg"
5+
"ranisenberg",
6+
"runtimes"
57
]
68
}

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
dev:
6-
pipenv install --dev
6+
pipenv install -d
77
make deps
88

99
lint:
@@ -23,7 +23,7 @@ pre-commit:
2323
pre-commit run -a
2424

2525
deps:
26-
pipenv lock -r -d > dev_requirements.txt
26+
pipenv lock --dev-only -r > dev_requirements.txt
2727
pipenv lock -r > lambda_requirements.txt
2828

2929
unit:

Pipfile.lock

Lines changed: 132 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cdk/aws_lambda_handler_cookbook/service_stack/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
POWERTOOLS_TRACE_DISABLED = 'POWERTOOLS_TRACE_DISABLED'
1414
POWER_TOOLS_LOG_LEVEL = 'LOG_LEVEL'
1515
BUILD_FOLDER = '.build/lambdas/'
16-
COMMION_LAYER_BUILD_FOLDER = '.build/common_layer'
16+
COMMON_LAYER_BUILD_FOLDER = '.build/common_layer'
1717
ENVIRONMENT = 'dev'
1818
CONFIGURATION_NAME = 'my_conf'
19-
CONFIGURATION_MAX_AGE_MINUTES = '5' # time to store appconfig conf in the cache before refetching it
19+
CONFIGURATION_MAX_AGE_MINUTES = '5' # time to store app config conf in the cache before refetching it
2020

2121

2222
def get_stack_name() -> str:

cdk/aws_lambda_handler_cookbook/service_stack/cookbook_construct.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from aws_cdk import CfnOutput, Duration, RemovalPolicy, aws_apigateway
77
from aws_cdk import aws_iam as iam
88
from aws_cdk import aws_lambda as _lambda
9+
from aws_cdk import aws_logs
910
from aws_cdk.aws_lambda_python_alpha import PythonLayerVersion
1011
from constructs import Construct
1112

@@ -56,7 +57,7 @@ def _build_common_layer(self) -> PythonLayerVersion:
5657
return PythonLayerVersion(
5758
self,
5859
'CommonLayer',
59-
entry=constants.COMMION_LAYER_BUILD_FOLDER,
60+
entry=constants.COMMON_LAYER_BUILD_FOLDER,
6061
compatible_runtimes=[_lambda.Runtime.PYTHON_3_8],
6162
removal_policy=RemovalPolicy.DESTROY,
6263
)
@@ -84,6 +85,7 @@ def __add_post_lambda_integration(self, api_name: aws_apigateway.Resource, role:
8485
memory_size=constants.API_HANDLER_LAMBDA_MEMORY_SIZE,
8586
layers=[self.common_layer],
8687
role=role,
88+
log_retention=aws_logs.RetentionDays.ONE_DAY,
8789
)
8890

8991
# POST /api/service/

cdk/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
install_requires=[
2626
'aws-cdk-lib>=2.0.0',
2727
'constructs>=10.0.0',
28-
'aws-cdk.aws-lambda-python-alpha==2.32.1-alpha.0',
28+
'aws-cdk.aws-lambda-python-alpha==2.35.0-alpha.0',
2929
],
3030
)

dev_requirements.txt

Lines changed: 63 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,84 @@
1+
#
2+
# These requirements were autogenerated by pipenv
3+
# To regenerate from the project's Pipfile, run:
4+
#
5+
# pipenv lock --requirements --dev-only
6+
#
7+
18
-i https://pypi.org/simple
29
-e ./cdk
3-
attrs==21.4.0
4-
aws-cdk-lib==2.33.0
5-
aws-cdk.aws-lambda-python-alpha==2.32.1a0
6-
boto3==1.24.33
7-
botocore==1.27.33
10+
-e ./cdk
11+
attrs==21.4.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
12+
aws-cdk-lib==2.35.0; python_version ~= '3.7'
13+
aws-cdk.aws-lambda-python-alpha==2.35.0a0; python_version ~= '3.7'
14+
boto3==1.24.46; python_version >= '3.7'
15+
botocore==1.27.46; python_version >= '3.7'
816
cattrs==1.10.0
9-
certifi==2022.6.15
10-
cfgv==3.3.1
11-
charset-normalizer==2.1.0
12-
click==8.1.3
13-
colorama==0.4.5 ; python_version > '3.4'
14-
constructs==10.1.51
15-
coverage[toml]==6.4.2
17+
certifi==2022.6.15; python_version >= '3.6'
18+
cfgv==3.3.1; python_full_version >= '3.6.1'
19+
charset-normalizer==2.1.0; python_version >= '3.6'
20+
click==8.1.3; python_version >= '3.7'
21+
colorama==0.4.5; python_version >= '3.5'
22+
constructs==10.1.67; python_version ~= '3.7'
23+
coverage[toml]==6.4.2; python_version >= '3.7'
1624
distlib==0.3.5
17-
filelock==3.7.1
18-
flake8==4.0.1
19-
future==0.18.2
25+
filelock==3.7.1; python_version >= '3.7'
26+
flake8==5.0.4
27+
future==0.18.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
2028
ghp-import==2.1.0
21-
gitdb==4.0.9
29+
gitdb==4.0.9; python_version >= '3.6'
2230
gitpython==3.1.27
23-
identify==2.5.2
24-
idna==3.3
25-
importlib-metadata==4.12.0 ; python_version < '3.10'
31+
identify==2.5.3; python_version >= '3.7'
32+
idna==3.3; python_version >= '3.5'
33+
importlib-metadata==4.12.0; python_version < '3.10'
2634
iniconfig==1.1.1
2735
isort==5.10.1
28-
jinja2==3.1.2
29-
jmespath==1.0.1
30-
jsii==1.62.0
36+
jinja2==3.1.2; python_version >= '3.7'
37+
jmespath==1.0.1; python_version >= '3.7'
38+
jsii==1.63.2; python_version ~= '3.7'
3139
mando==0.6.4
32-
markdown==3.3.7
33-
markupsafe==2.1.1
34-
mccabe==0.6.1
35-
mergedeep==1.3.4
40+
markdown==3.3.7; python_version >= '3.6'
41+
markupsafe==2.1.1; python_version >= '3.7'
42+
mccabe==0.7.0; python_version >= '3.6'
43+
mergedeep==1.3.4; python_version >= '3.6'
3644
mkdocs-git-revision-date-plugin==0.3.2
37-
mkdocs-material-extensions==1.0.3
45+
mkdocs-material-extensions==1.0.3; python_version >= '3.6'
3846
mkdocs-material==8.3.9
39-
mkdocs==1.3.1
40-
nodeenv==1.7.0
41-
packaging==21.3
42-
platformdirs==2.5.2
43-
pluggy==1.0.0
47+
mkdocs==1.3.1; python_version >= '3.6'
48+
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'
49+
packaging==21.3; python_version >= '3.6'
50+
platformdirs==2.5.2; python_version >= '3.7'
51+
pluggy==1.0.0; python_version >= '3.6'
4452
pre-commit==2.20.0
4553
publication==0.0.3
46-
py==1.11.0
47-
pycodestyle==2.8.0
48-
pyflakes==2.4.0
49-
pygments==2.12.0
50-
pymdown-extensions==9.5
51-
pyparsing==3.0.9
54+
py==1.11.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
55+
pycodestyle==2.9.1
56+
pyflakes==2.5.0; python_version >= '3.6'
57+
pygments==2.12.0; python_version >= '3.6'
58+
pymdown-extensions==9.5; python_version >= '3.7'
59+
pyparsing==3.0.9; python_full_version >= '3.6.8'
5260
pytest-cov==3.0.0
5361
pytest-html==3.1.1
54-
pytest-metadata==2.0.2
62+
pytest-metadata==2.0.2; python_version >= '3.7' and python_version < '4'
5563
pytest-mock==3.8.2
5664
pytest==7.1.2
57-
python-dateutil==2.8.2
65+
python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
5866
python-dotenv==0.20.0
59-
pyyaml-env-tag==0.1
60-
pyyaml==6.0
67+
pyyaml-env-tag==0.1; python_version >= '3.6'
68+
pyyaml==6.0; python_version >= '3.6'
6169
radon==5.1.0
62-
requests==2.28.1
63-
s3transfer==0.6.0
64-
six==1.16.0
65-
smmap==5.0.0
66-
toml==0.10.2
67-
tomli==2.0.1
68-
typing-extensions==4.3.0
69-
urllib3==1.26.10
70-
virtualenv==20.15.1
71-
watchdog==2.1.9
70+
requests==2.28.1; python_version >= '3.7' and python_version < '4'
71+
s3transfer==0.6.0; python_version >= '3.7'
72+
setuptools==63.4.1; python_version >= '3.7'
73+
six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
74+
smmap==5.0.0; python_version >= '3.6'
75+
toml==0.10.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
76+
tomli==2.0.1; python_version >= '3.7'
77+
typeguard==2.13.3; python_full_version >= '3.5.3'
78+
typing-extensions==4.3.0; python_version >= '3.7'
79+
urllib3==1.26.11; 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.0'
80+
virtualenv==20.16.3; python_version >= '3.6'
81+
watchdog==2.1.9; python_version >= '3.6'
7282
xenon==0.9.0
7383
yapf==0.32.0
74-
zipp==3.8.1
84+
zipp==3.8.1; python_version >= '3.7'

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ What makes an AWS Lambda handler resilient, traceable and easy to maintain? How
1010

1111
The project is a template project that is based on my AWS Lambda handler cookbook blog series that I publish in [ranthebuilder.cloud](https://www.ranthebuilder.cloud){:target="_blank" rel="noopener"} and attempt to answer those questions.
1212

13+
The GitHub template project can be found at [https://github.com/ran-isenberg/aws-lambda-handler-cookbook](https://github.com/ran-isenberg/aws-lambda-handler-cookbook){:target="_blank" rel="noopener"}.
14+
1315
- This project provides a working, open source based, AWS Lambda handler skeleton Python code including DEPLOYMENT code with CDK.
1416

1517
- The project deploys an API GW with an AWS Lambda integration under the path POST /api/service/.

lambda_requirements.txt

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1+
#
2+
# These requirements were autogenerated by pipenv
3+
# To regenerate from the project's Pipfile, run:
4+
#
5+
# pipenv lock --requirements
6+
#
7+
18
-i https://pypi.org/simple
2-
aws-lambda-powertools==1.26.5
9+
aws-lambda-powertools==1.27.0
310
aws-xray-sdk==2.10.0
4-
boto3==1.24.33
5-
botocore==1.27.33
6-
dnspython==2.2.1
11+
boto3==1.24.46; python_version >= '3.7'
12+
botocore==1.27.46; python_version >= '3.7'
13+
dnspython==2.2.1; python_version >= '3.6' and python_version < '4.0'
714
email-validator==1.2.1
815
fastjsonschema==2.16.1
9-
idna==3.3
10-
jmespath==1.0.1
16+
idna==3.3; python_version >= '3.5'
17+
jmespath==1.0.1; python_version >= '3.7'
1118
pydantic[email]==1.9.1
12-
python-dateutil==2.8.2
13-
s3transfer==0.6.0
14-
six==1.16.0
15-
typing-extensions==4.3.0
16-
urllib3==1.26.10
17-
wrapt==1.14.1
19+
python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
20+
s3transfer==0.6.0; python_version >= '3.7'
21+
six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
22+
typing-extensions==4.3.0; python_version >= '3.7'
23+
urllib3==1.26.11; 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.0'
24+
wrapt==1.14.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'

0 commit comments

Comments
 (0)