alvyn279 / discord-events

AWS-hosted Discord bot to schedule events
2 stars 0 forks source link

Road Map #1

Open alvyn279 opened 3 years ago

alvyn279 commented 3 years ago

Takeaways

  1. For single-task services, setting the desired tasks count matters at creation and at deploy time Solution: Set to 0 before update as per docs. Better solution: USE DAEMON MODE !! https://github.com/aws/aws-cdk/issues/5215 https://github.com/aws/aws-cdk/pull/12223 https://github.com/aws/aws-cdk/issues/11951
  2. NAT Gateway for persistent connections will eat your wallet.
Stochastic-Adventure commented 3 years ago

Hi!

This is a wonderful repo as I am looking to build a similar bot with AWS ECS as well.

Just curious what is the cost after removing the NAT Gateway?

Thanks in advance!

alvyn279 commented 3 years ago

Hey @Stochastic-Adventure ,

I recall being charged around 2$/day solely for bot heartbeat (every 1-2 mins) traffic going through the NAT Gateway.

I think running continuously a single image of the bot cost around 8-10$ a month or so.

Stochastic-Adventure commented 3 years ago

Thanks!

$8-10 / month is reasonable.

One more question: did you use AWS Secrets Manager to store bot token?

alvyn279 commented 3 years ago

Thanks!

$8-10 / month is reasonable.

One more question: did you use AWS Secrets Manager to store bot token?

Nope, I have it as an env var, but modifying the bot to make use of SM would probably be best practice here. Might be cheap too.

This being said, the current bot setup I have makes it quite hard to attack the secret as env var on the containerized app. The ec2 instance has no public IP, being in its own VPC, and what not.