Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rajyan authored Sep 12, 2022
1 parent 6985b52 commit 87e421f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

# Low-Cost ECS

A CDK construct that provides easy and [low-cost](#cost) ECS on EC2 server setup without a load balancer.
A CDK construct that provides an easy and [low-cost](#cost) ECS on EC2 server setup without a load balancer.

**This construct is for development purposes only**. See [Limitations](#limitations).

# Why

ECS may often seem expensive when used for personal development purposes, due to the cost of the load balancer.
The application load balancer is a great service that is easy to set up managed ACM certificates, it scales, and has dynamic port mappings and so on, but it is over-featured for running 1 ECS task.
The application load balancer is a great service that is easy to set up managed ACM certificates, easy scaling, and has dynamic port mappings..., but it is over-featured for running 1 ECS task.

However, to run an ECS server without a load balancer, you need to associate an Elastic IP to the host instance and install your certificate to your service every time you start up the server.
This construct aims to automate these works and to make it easy to deploy resources to run a low-cost ECS server.
This construct aims to automate these works and make it easy to deploy resources to run a low-cost ECS server.

# Try it out!

Expand All @@ -29,7 +29,7 @@ yarn install
./node_modules/.bin/cdk deploy
```

Access to configured `recordDomainNames` and see that the nginx sample server has been deployed.
Access the configured `recordDomainNames` and see that the Nginx sample server has been deployed.

# Installation

Expand Down Expand Up @@ -108,16 +108,15 @@ After your 12 Months Free period, setting [`hostInstanceSpotPrice`](https://gith

* SSM Session Manager

SSM manager is pre-installed (in ECS-optimized Amazon Linux 2 AMI) in the host instance and `AmazonSSMManagedInstanceCore` is added to the host instance role
to access and debug in your host instance.
SSM manager is pre-installed in the host instance (by ECS-optimized Amazon Linux 2 AMI) and `AmazonSSMManagedInstanceCore` is added to the host instance role to access and debug in your host instance.

```
aws ssm start-session --target $INSTANCE_ID
```

* ECS Exec

Service ECS Exec is enabled, so execute commands can be used to debug in your server task container.
Service ECS Exec is enabled, so execute commands can be used to debug your server task container.

```
aws ecs execute-command \
Expand All @@ -130,7 +129,7 @@ aws ecs execute-command \

# Limitations

The ECS service occupies the host port, so only one service can be run at a time.
Because the ECS service occupies a host port, only one task can be executed at a time.
The old task must be terminated before the new task launches, and this causes downtime on release.

Also, if you make changes that require recreating service, you may need to manually terminate the task of old the service.
Also, if you make changes that require recreating the service, you may need to manually terminate the task of the old service.

0 comments on commit 87e421f

Please sign in to comment.