CoolFace
Apppublic

foxelas/astrology_bot_for_bluesky

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
App README

AstrologyBotGR

Make a package including the dependencies layer

mkdir -p dependencies_layer/python
pip install -r requirements.txt --platform manylinux2014_x86_64 -t dependencies_layer/python --only-binary=:all:

# The libraries should be in directory: python/lib/python3.x/site-packages
# or in the newer version simply in: python
# Remove __pycache__ directories
cd dependencies_layer
zip -r ../dependencies_layer.zip .

To add it to a layer do and use the resulting LayerVersionArn

 aws lambda publish-layer-version --layer-name python-dependencies-layer \
    --zip-file fileb://dependencies_layer.zip \
    --compatible-runtimes python3.13 \
    --compatible-architectures "x86_64"

Make a package including the main deployment code

cd src
zip -r ../lambda_function.zip .

Deploy the package

aws lambda create-function \
  --function-name witty-comment-bot \
  --runtime python3.x \
  --role arn:aws:iam::YOUR_ACCOUNT_ID:role/LambdaBasicExecutionRole \
  --handler app.lambda_handler \
  --timeout 120 \
  --memory-size 128 \
  --zip-file fileb://lambda_function.zip

EventBridge scheduler

bridge create schedule \
  --name hourly-witty-comment-bot \
  --rate 1 hour \
  --lambda witty-comment-bot

User permissions IAM

  • —AWSLambdaBasicExecutionRole
  • —AWSLambdaRole
  • —lambda:PublishLayerVersion

To test

  aws lambda invoke \
  --function-name astrologyBotGR \
  output.json