https://github.com/wiiisdom/ec2-leaser
Start EC2 from selected AMI and with the correct tags
https://github.com/wiiisdom/ec2-leaser
aws ec2 react sst
Last synced: 5 months ago
JSON representation
Start EC2 from selected AMI and with the correct tags
- Host: GitHub
- URL: https://github.com/wiiisdom/ec2-leaser
- Owner: wiiisdom
- Created: 2018-11-21T14:33:50.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2026-02-09T21:59:38.000Z (5 months ago)
- Last Synced: 2026-02-10T00:56:00.012Z (5 months ago)
- Topics: aws, ec2, react, sst
- Language: TypeScript
- Homepage:
- Size: 9.44 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ec2-leaser
A tiny tool to allow google user to start EC2 instances from a list of Launch Template already created. It can be used to not provide `startInstance` IAM right yo your users.

It's also possible to snapshot and restore instances!
## Architecture
It's a fullstack application (NextJs) deployed via [SST](https://sst.dev/) on AWS.
## How to run the application locally ?
Run the multiplexer if you want to work with the cron job
```
pnpm install
pnpm sst dev
```
Run to work with the app
```
pnpm install
pnpm dev
```
## How to deploy the application
Deploy the infrastructure with SST (front and back stack)
(it push the frontend to S3 and invalidate cloudfront distribution)
```
AWS_REGION=eu-central-1 pnpm sst deploy --stage prod # on aws prod account
AWS_REGION=us-east-1 pnpm sst deploy --stage demo # on aws demo account
```
### Cost center data content
To add cost center list so that the frontend can make use of it, add items directly from the AWS GUI:
visit [DynamoDB section](https://console.aws.amazon.com/dynamodbv2/home)
search for `{stage}-ec2-leaser-config`
See below for an example on how to enter the items in the table:
| PK | SK | description |
| ----------- | -------------------- | ----------------------------------------------------- |
| costcenters | eng:360Eyes | Usage for Engineering 360Eyes |
| costcenters | eng:360WP | Usage for Engineering 360WebPlatform |
| costcenters | eng:lab | Generic Lab usage |
| schedules | lille-office-stop | Stop automatically the instance at 7pm (CET timezone) |
| schedules | montreal-office-stop | Stop automatically the instance at 7pm (EST timezone) |