Skip to content

Wk15 practice #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions Lambda/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Lambda/Working-with-Lambda-Layers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Create a new virtual environment using `pipenv` and install the required libraries:

```sh
pipenv --python 3.7
pipenv --python 3.10 #3.7
pipenv shell
pipenv install requests
```
Expand All @@ -23,11 +23,11 @@ pip3 install pipenv --user
Create the ZIP deployment package:

```sh
PY_DIR='build/python/lib/python3.7/site-packages'
PY_DIR='build/python/lib/python3.10/site-packages' #in place of python3.7
# Create temporary build directory
mkdir -p $PY_DIR
# Generate requirements file
pipenv lock -r > requirements.txt
pipenv requirement > requirements.txt # This is in place of previous " pipenv lock -r > requirements.txt"
# Install packages into the target directory
pip install -r requirements.txt --no-deps -t $PY_DIR
cd build
Expand Down
2 changes: 1 addition & 1 deletion Lambda/Working-with-Lambda-Layers/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def lambda_handler(event, context):

response = requests.get('https://linuxacademy.com')
response = requests.get('https://www.google.com') # in place of ('https://linuxacademy.com')
if response:
print('Success!')
else:
Expand Down
6 changes: 6 additions & 0 deletions Lambda/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-i https://pypi.org/simple
certifi==2022.12.7 ; python_version >= '3.6'
charset-normalizer==3.1.0 ; python_full_version >= '3.7.0'
idna==3.4 ; python_version >= '3.5'
requests==2.29.0
urllib3==1.26.15 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'