Skip to content

Commit

Permalink
Speed up ryhti client (#392)
Browse files Browse the repository at this point in the history
* Remove useless code db queries

* Improve logging

* Move all non-event specific init out of handler

* Move all non-event specific init out of handler

* Remove redundant resource from api policy

* Add provisioned concurrency and publish new version at deploy

* Redeploy api at any resource change

* Add suitable lambda memory size

* Add missing lambda publish and update permissions

* Wait for function to update before publishing version

* Fix sh script syntax
  • Loading branch information
Rikuoja authored Nov 27, 2024
1 parent 1db1a26 commit bcf0307
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions infra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ update-ryhti-client:
docker tag hame-ryhti-ryhti_client:latest $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com/$(prefix)-ryhti_client:latest
docker push $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com/$(prefix)-ryhti_client:latest
aws lambda update-function-code --function-name $(prefix)-ryhti_client --image-uri $(AWS_ACCOUNT_ID).dkr.ecr.$(AWS_REGION).amazonaws.com/$(prefix)-ryhti_client:latest
while aws lambda get-function --function-name hame-dev-ryhti_client --query "Configuration.LastUpdateStatus" | grep "InProgress";
while aws lambda get-function --function-name hame-dev-ryhti_client --query "Configuration.LastUpdateStatus" | grep "InProgress"
do
sleep 1
echo "Waiting for AWS to complete function update..."
done;
done
aws lambda publish-version --function-name $(prefix)-ryhti_client --query "Version" | \
xargs -I {} aws lambda update-alias --function-name $(prefix)-ryhti_client --name live --function-version {}

Expand Down

0 comments on commit bcf0307

Please sign in to comment.