-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae9f65a
commit b291605
Showing
3 changed files
with
18 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ venv/* | |
.vscode | ||
.idea | ||
config.yml | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
|
@@ -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 | ||
--- | ||
|
@@ -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 | ||
|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ zappa | |
awsudo | ||
awscli | ||
influxdb-client | ||
urllib3==1.26.18 | ||
requests==2.32.0 | ||
requests | ||
setuptools |