Skip to content

Commit

Permalink
chore: rename project (#32)
Browse files Browse the repository at this point in the history
Fixes #
  • Loading branch information
rajyan authored Sep 11, 2022
1 parent 18615ab commit e8b7ba3
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 195 deletions.
8 changes: 4 additions & 4 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const excludes = ['.idea/', 'cdk.out/', 'cdk.context.json', 'yarn-error.log'];
const project = new awscdk.AwsCdkConstructLibrary({
author: 'Yohta Kimura',
authorAddress: '[email protected]',
name: 'easy-cerver',
name: 'low-cost-ecs',
description: 'Easy and low-cost ECS on EC2 server without a load balancer',
repositoryUrl: 'https://github.com/rajyan/easy-cerver.git',
repositoryUrl: 'https://github.com/rajyan/low-cost-ecs.git',
license: 'MIT',
cdkVersion: '2.37.0',
defaultReleaseBranch: 'main',
Expand All @@ -26,8 +26,8 @@ const project = new awscdk.AwsCdkConstructLibrary({
stability: 'experimental',

python: {
distName: 'easy-cerver',
module: 'eascy_cerver',
distName: 'low-cost-ecs',
module: 'low_cost_ecs',
},

npmignore: excludes,
Expand Down
322 changes: 161 additions & 161 deletions API.md

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[![NPM version](https://badge.fury.io/js/easy-cerver.svg)](https://www.npmjs.com/package/easy-cerver)
[![PyPI version](https://badge.fury.io/py/easy-cerver.svg)](https://pypi.org/project/easy-cerver/0.0.4/)
[![Release](https://github.com/rajyan/easy-cerver/workflows/release/badge.svg)](https://github.com/rajyan/easy-cerver/actions/workflows/release.yml)
[<img src="https://constructs.dev/badge?package=easy-cerver" width="150">](https://constructs.dev/packages/easy-cerver)
[![NPM version](https://badge.fury.io/js/low-cost-ecs.svg)](https://www.npmjs.com/package/low-cost-ecs)
[![PyPI version](https://badge.fury.io/py/low-cost-ecs.svg)](https://pypi.org/project/low-cost-ecs/0.0.4/)
[![Release](https://github.com/rajyan/low-cost-ecs/workflows/release/badge.svg)](https://github.com/rajyan/low-cost-ecs/actions/workflows/release.yml)
[<img src="https://constructs.dev/badge?package=low-cost-ecs" width="150">](https://constructs.dev/packages/low-cost-ecs)

# Easy Cerver
# Low-Cost ECS

A CDK construct that provides easy and low-cost ECS on EC2 server setup without a load balancer.
TLS/SSL certificates are installed automatically on startup of the server and renewed by a scheduled state machine using [certbot-dns-route53](https://certbot-dns-route53.readthedocs.io/en/stable/).
Expand All @@ -13,11 +13,11 @@ TLS/SSL certificates are installed automatically on startup of the server and re
# Try it out!

The easiest way to see what this construct creates is to clone this repository and deploying sample server.
Edit settings in `bin/easy-cerver.ts` and deploy cdk construct. [Public hosted zone](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html) with your own domain is required.
Edit settings in `bin/low-cost-ecs.ts` and deploy cdk construct. [Public hosted zone](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html) with your own domain is required.

```
git clone https://github.com/rajyan/easy-cerver.git
# edit settings in bin/easy-cerver.ts
git clone https://github.com/rajyan/low-cost-ecs.git
# edit settings in bin/low-cost-ecs.ts
npx cdk deploy
```

Expand All @@ -28,23 +28,23 @@ Access to configured `recordDomainNames` and see that the nginx sample server ha
To use this construct in your own cdk stack as a library,

```
npm install easy-cerver
npm install low-cost-ecs
```

```ts
import { Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { EasyCerver } from 'easy-cerver';
import { LowCostECS } from 'low-cost-ecs';

class SampleStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);

const vpc = /** Your VPC */
const securityGroup = /** Your security group */
const serverTaskDefinition = /** Your task definition */
const vpc = /** Your VPC */;
const securityGroup = /** Your security group */;
const serverTaskDefinition = /** Your task definition */;

new EasyCerver(this, 'EasyCerver', {
new LowCostECS(this, 'LowCostECS', {
hostedZoneDomain: "rajyan.net",
email: "[email protected]",
vpc: vpc,
Expand All @@ -56,7 +56,7 @@ class SampleStack extends Stack {
```

The required fields are `hostedZoneDomain` and `email`.
Set your own task definition, and other props. Read [`EasyCerverProps` documentation](https://github.com/rajyan/easy-cerver/blob/main/API.md#easy-cerver.EasyCerverProps) for details.
Set your own task definition, and other props. Read [`LowCostECSProps` documentation](https://github.com/rajyan/low-cost-ecs/blob/main/API.md#low-cost-ecs.LowCostECSProps) for details.

# Why

Expand All @@ -73,7 +73,7 @@ This construct aims to automate these work and deploying resources to run low-co

All resources except Route53 HostedZone should be included in [AWS Free Tier](https://docs.aws.amazon.com/whitepapers/latest/how-aws-pricing-works/get-started-with-the-aws-free-tier.html)
***if you are in the 12 Months Free period***.
After your 12 Months Free period, setting [`hostInstanceSpotPrice`](https://github.com/rajyan/easy-cerver/blob/main/API.md#easy-cerver.EasyCerverProps.property.hostInstanceSpotPrice) to use spot instances is recommended.
After your 12 Months Free period, setting [`hostInstanceSpotPrice`](https://github.com/rajyan/low-cost-ecs/blob/main/API.md#low-cost-ecs.LowCostECSProps.property.hostInstanceSpotPrice) to use spot instances is recommended.

* EC2
* t2,micro 750 instance hours (12 Months Free Tier)
Expand All @@ -84,7 +84,7 @@ After your 12 Months Free period, setting [`hostInstanceSpotPrice`](https://gith
* Usage is very small, it should be free
* Cloud Watch
* Usage is very small, and it should be included in the free tier
* Enabling [`containerInsights`](https://github.com/rajyan/easy-cerver/blob/main/API.md#easy-cerver.EasyCerverProps.property.containerInsights) will charge for custom metrics
* Enabling [`containerInsights`](https://github.com/rajyan/low-cost-ecs/blob/main/API.md#low-cost-ecs.LowCostECSProps.property.containerInsights) will charge for custom metrics

# Debugging

Expand Down
4 changes: 2 additions & 2 deletions bin/easy-cerver.ts → bin/low-cost-ecs.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { App } from "aws-cdk-lib";
import { EasyCerver } from '../src';
import { LowCostECS } from '../src';

const app = new App();

new EasyCerver(app, "EasyCerverStack", {
new LowCostECS(app, "LowCostECSStack", {
env: {
account: process.env.CDK_DEFAULT_ACCOUNT,
region: process.env.CDK_DEFAULT_REGION,
Expand Down
2 changes: 1 addition & 1 deletion cdk.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"app": "npx ts-node --prefer-ts-exts bin/easy-cerver.ts"
"app": "npx ts-node --prefer-ts-exts bin/low-cost-ecs.ts"
}
8 changes: 4 additions & 4 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './easy-cerver';
export * from './low-cost-ecs';
6 changes: 3 additions & 3 deletions src/easy-cerver.ts → src/low-cost-ecs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
import * as sfn_tasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
import { Construct } from 'constructs';

export interface EasyCerverProps extends lib.StackProps {
export interface LowCostECSProps extends lib.StackProps {
/**
* Domain name of the hosted zone.
*/
Expand Down Expand Up @@ -120,8 +120,8 @@ export interface EasyCerverProps extends lib.StackProps {
readonly serverTaskDefinition?: ecs.Ec2TaskDefinition;
};

export class EasyCerver extends lib.Stack {
constructor(scope: Construct, id: string, props: EasyCerverProps) {
export class LowCostECS extends lib.Stack {
constructor(scope: Construct, id: string, props: LowCostECSProps) {
super(scope, id, props);

const vpc =
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions test/easy-cerver.test.ts → test/low-cost-ecs.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { App } from 'aws-cdk-lib';
import { Template } from 'aws-cdk-lib/assertions';
import { EasyCerver } from '../src';
import { LowCostECS } from '../src';

test('Template matches snapshot', () => {
const app = new App();
const stack = new EasyCerver(app, 'MyTestStack', {
const stack = new LowCostECS(app, 'MyTestStack', {
env: {
account: 'dummy-id',
region: 'dummy-region',
Expand Down

0 comments on commit e8b7ba3

Please sign in to comment.