Skip to content
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

Made some minor changes due to recent change on AWS API call data structure or Pipenv commands #11

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion Lambda/CodeCommit-Change-Notification/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import boto3

AWS_DEFAULT_REGION = os.environ["AWS_DEFAULT_REGION"]
MAIN_BRANCH_NAME = os.getenv('MAIN_BRANCH_NAME', 'master')
MAIN_BRANCH_NAME = os.getenv('MAIN_BRANCH_NAME', 'main') # CodeCommit now use 'main' branch rather than 'master' branch
REPOSITORY_NAME = os.environ['REPOSITORY_NAME']
SNS_TOPIC_ARN = os.environ['SNS_TOPIC_ARN']

Expand Down
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'
6 changes: 3 additions & 3 deletions Monitoring-Debugging/CloudWatch-Custom-Metrics/URLs.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
GET https://q4mss37szc.execute-api.us-east-2.amazonaws.com/Prod/cart/add
GET https://q4mss37szc.execute-api.us-east-2.amazonaws.com/Prod/cart/purchase
GET https://q4mss37szc.execute-api.us-east-2.amazonaws.com/Prod/products/123456
GET https://78f51hcj4j.execute-api.us-east-1.amazonaws.com/Prod/cart/add
GET https://78f51hcj4j.execute-api.us-east-1.amazonaws.com/Prod/cart/purchase
GET https://78f51hcj4j.execute-api.us-east-1.amazonaws.com/Prod/products/123456
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description: Shopping cart app
Globals:
Function:
Handler: app.lambda_handler
Runtime: python3.7
Runtime: python3.10
Tracing: Active
Timeout: 3

Expand Down
12 changes: 12 additions & 0 deletions Monitoring-Debugging/Tracing-with-X-Ray/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.10"
python_full_version = "3.10.6"
16 changes: 16 additions & 0 deletions Monitoring-Debugging/Tracing-with-X-Ray/Pipfile-backup
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
aws-xray-sdk = "*"
flask = "*"
zappa = "*"
requests = "*"

[dev-packages]

[requires]
python_version = "3.10"
python_full_version = "3.10.6"
Loading