Skip to content
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
29 changes: 12 additions & 17 deletions .github/workflows/deploy-bot-commands-processing-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,17 @@ jobs:
aws lambda wait function-updated \
--function-name aviation-telegram-bot-bot-commands-processing

- name: Set Lambda Environment Variables
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
FLIGHTRADAR_API_LAMBDA_NAME: aviation-telegram-bot-flightradar-api-get-scheduled-flights
- name: Publish Lambda Version
id: publish
run: |
aws lambda update-function-configuration \
VERSION=$(aws lambda publish-version \
--function-name aviation-telegram-bot-bot-commands-processing \
--environment "$(jq -n '{Variables: {
BOT_TOKEN: env.BOT_TOKEN,
DB_HOST: env.DB_HOST,
DB_NAME: env.DB_NAME,
DB_USERNAME: env.DB_USERNAME,
DB_PASSWORD: env.DB_PASSWORD,
FLIGHTRADAR_API_LAMBDA_NAME: env.FLIGHTRADAR_API_LAMBDA_NAME
}}')"
--query 'Version' --output text)
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Update Live Alias
run: |
aws lambda update-alias \
--function-name aviation-telegram-bot-bot-commands-processing \
--name live \
--function-version ${{ steps.publish.outputs.version }}
4 changes: 4 additions & 0 deletions terraform/lambda_bot_commands.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ resource "aws_lambda_alias" "bot_commands_processing" {
name = "live"
function_name = aws_lambda_function.bot_commands_processing.function_name
function_version = aws_lambda_function.bot_commands_processing.version

lifecycle {
ignore_changes = [function_version]
}
}

resource "aws_lambda_function_url" "bot_commands_processing" {
Expand Down
Loading