Skip to content

Commit

Permalink
Bump Python runtime to version 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleykleynhans committed May 31, 2024
1 parent ae9f65a commit b291605
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ venv/*
.vscode
.idea
config.yml
.DS_Store
35 changes: 15 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Target Groups, trigger Jenkins jobs to perform specific actions
(for example removing the affected instance from monitoring systems),
and log to InfluxDB.

[![Python Version: 3.9](
https://img.shields.io/badge/Python%20application-v3.9-blue
)](https://www.python.org/downloads/release/python-3913/)
[![Python Version: 3.12](
https://img.shields.io/badge/Python%20application-v3.12-blue
)](https://www.python.org/downloads/release/python-3123/)
[![License: GPL 3.0](
https://img.shields.io/github/license/ashleykleynhans/sns-webhook-spot-interruption-warning
)](https://opensource.org/licenses/GPL-3.0)
Expand All @@ -22,24 +22,19 @@ https://img.shields.io/github/license/ashleykleynhans/sns-webhook-spot-interrupt
```bash
brew install ngrok
```
2. Ensure your System Python3 version is 3.9, but greater than 3.9.1.
2. Ensure your System Python3 version is 3.12.
```bash
python3 -V
```
3. If your System Python is not 3.9:
3. If your System Python is not 3.12:
```bash
brew install python@3.9
brew link python@3.9
brew install python@3.12
brew link python@3.12
```
4. If your System Python is 3.9 but not greater than 3.9.1:
```bash
brew update
brew upgrade [email protected]
```
5. [Create a new Slack App](https://api.slack.com/start).
6. Create your Slack channel where you want to receive your SNS notifications.
7. Configure SNS to send notifications to that channel.
8. Create a configuration file called `config.yml` in the same directory
4. [Create a new Slack App](https://api.slack.com/start).
5. Create your Slack channel where you want to receive your SNS notifications.
6. Configure SNS to send notifications to that channel.
7. Create a configuration file called `config.yml` in the same directory
as the webhook script that looks like this:
```yml
---
Expand Down Expand Up @@ -118,10 +113,10 @@ while ngrok is running **(be sure to use the https one)**.

## Deploy to AWS Lambda

1. Create a Python 3.9 Virtual Environment:
1. Create a Python 3.12 Virtual Environment:
```bash
python3 -m venv venv/py3.9
source venv/py3.9/bin/activate
python3 -m venv venv/py3.12
source venv/py3.12/bin/activate
```
2. Upgrade pip.
```bash
Expand All @@ -141,7 +136,7 @@ to configure your AWS Lambda deployment:
"lambda_description": "Webhook to handle EC2 Spot Instance Interruption Warnings",
"profile_name": "default",
"project_name": "spot-interruption-warning",
"runtime": "python3.9",
"runtime": "python3.12",
"s3_bucket": "sns-spot-interruptions",
"tags": {
"service": "spot-interruption-warning"
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ zappa
awsudo
awscli
influxdb-client
urllib3==1.26.18
requests==2.32.0
requests
setuptools

0 comments on commit b291605

Please sign in to comment.